Determine if page is set as Home?

Posted by Community Admin on 04-Aug-2018 03:09

Determine if page is set as Home?

All Replies

Posted by Community Admin on 07-May-2013 00:00

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

Posted by Community Admin on 07-May-2013 00:00

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;

Regards,
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

Posted by Community Admin on 03-Jan-2017 00:00

if (SystemManager.CurrentContext.CurrentSite.HomePageId == Telerik.Sitefinity.Web.SiteMapBase.GetActualCurrentNode().Id)
    // homepage

This thread is closed