This Razor Page is called when an instance of the content type is routed to, if it is chosen as the renderer for the content instance. Your page model should inherit from, where T is your content model. To add new template as a Razor Page, create a new Razor Page in the Pages folder in your project. With the added rendering using Html.PropertyFor, you can edit the property in the On-Page Editing view. Public PageControllerBase(UISignInManager uiSignInManager)Įxample: The corresponding rendering view for displaying the Article page. Private readonly UISignInManager _uiSignInManager Public abstract class PageControllerBase : PageController, IModifyLayout ![]() Public ActionResult Index(ArticlePage currentPage)Įxample: The page controller base, inheriting from PageController, and with SitePageData as generic type. Public ArticlePageController(UISignInManager uiSignInManager) : base(uiSignInManager) Public class ArticlePageController : PageControllerBase The controller for displaying the Article page type, inheriting from PageControllerBase. To render properties you can use HTML helpers in MVC, for example, Html.PropertyFor , which renders property values based on their property type. HTML helpers are described more below.Įxample: The following example uses the content types created in Content types. (View model is not used in these examples to keep the examples simpler.) You can also add a view models to add more than just page objects to the views. You should follow the standard naming conventions in MVC for your model, controllers, and views.Ī page controller base class lets multiple pages reuse logic, which holds logic for a logout action, and inherits from PageController. To add the corresponding view for the controller, create a subfolder under Views and add an item of type View. This controller is called when an instance of the content type is routed to, if it is chosen as the renderer for the content instance. To add a new template controller, create a new MVC controller in the Controllers folder in your project. Your controller should inherit from (or optionally for PageData instances), where T is your content model. Extending the Tasks pane with custom queries.Creating a component for a Web Form (Legacy).Hiding or controlling access to customized components.Extending the navigation Optimizely CMS 11.21 and higher.Headless mode: enable multi-channel content in Optimizely.Configuring email notifications for content approvals.Integrate the Welcome DAM Library Picker. ![]() Restricting content types in properties.Converting page types for pages (Legacy).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |