There might be situations where you want to display content on all pages except the home page. For page speed reasons, you want to check this before loading the content.
To implement this, we need to prepare a variable that we can use to check if we are currently on the Home tab.
How to:
theme-body.ascx
OnLoad
var portal = DotNetNuke.Entities.Portals.PortalSettings.Current;
IsHome = portal.HomeTabId == portal.ActiveTab.TabID;
IsHome will return true when the page being loaded is the Home tab, and will return false on all other pages.
IsHome
true
false
You can now use it to create conditions in your template.