In this tutorial, you will learn how to access both the Episerver start page and root page object in code. Getting a reference to these objects is very useful during a build. If you need to access global settings, menu items, container pages, or even a setting page, you will normally need to reference one of these pages first. Luckily, it is extremely easy to access both objects 🔥🔥🔥.
Below shows you how to get a reference to the start page, root page and as an added bonus the block folder:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EPiServer.Core.ContentReference.StartPage | |
EPiServer.Core.ContentReference.RootPage | |
EPiServer.Core.ContentReference.SiteBlockFolder |
By using this one-liner with the IContentRepository
, you can then get access to the complete page in code! Happy Coding 🤘