How to get sitename of kentico site in production server

SSO Gagas Imaji asked on July 20, 2016 20:02

I have 2 servers running that server staging and production, then I have a function that is created in the staging server where the function has a variable that stores data sitename kentico in production server, the question is how can I know sitename that are in the production server dynamically?

Recent Answers

Zachary Perry answered on July 20, 2016 20:32

var name = SiteContext.CurrentSiteName;

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on July 21, 2016 15:06

TO Zach's point, you can use the SiteContext.CurrentSiteName to get the current site's name, as long as that's the same on staging and production you are fine.

If the SiteName's are different, then you would have to do a lookup of that somewhere, there isn't a macro that can reach over to another server and get the sitename unless you create a web service on the live server and make a custom macro to do a lookup, but i've never seen that case....

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.