Try our conversational search powered by Generative AI!

Retrieve siteId and siteName for a PageData instance



Previously one could get siteId and siteUrl for a specific PageData instance in a multisite enterprise environment with following code:

var siteId = DataFactory.Instance.GetSettingsFromContent(page.ContentLink).Parent.SiteId;
var siteUrl = DataFactory.Instance.GetSettingsFromContent(content.ContentLink).SiteUrl;


But well, guess that's now out of the question. Is there a clean way to get SiteDefinitions for a specific PageData instance?

Mar 16, 2014 17:29
var resolver = ServiceLocator.Current.GetInstance<SiteDefinitionResolver>();
var site = resolver.GetDefinitionForContent(page.ContentLink);
var siteId = site.Id;
var siteUrl = site.SiteUrl;


Mar 16, 2014 19:41

Thank you, Valdis!

Mar 16, 2014 23:00
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.