Determine if page is set as Home? - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Determine if page is set as Home?

  • Determine if page is set as Home?
  • I have the node and data page objects, but I'm usure how to know if the page is marked as "Home" or not?
  • Hello,

    The following piece of code will give you the home page ID (if in multysite you will get the home page for the current site):

    var homePageId = SystemManager.CurrentContext.CurrentSite.HomePageId;

    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • if (SystemManager.CurrentContext.CurrentSite.HomePageId == Telerik.Sitefinity.Web.SiteMapBase.GetActualCurrentNode().Id)
        // homepage