Tutorial 2 - Creating a simple content public page

In this tutorial we will create a simple public page with a title and rich text field.
The content page item only contains three fields:

First we need to create the model that will represent our content page item:

using DevPartner.Nop.Plugin.Core.Attributes;
using DevPartner.Nop.Plugin.Core.Models.CMS;
using DevPartner.Nop.Plugin.Core.Models;

namespace DevPartner.Nop.Plugin.Misc.StartedKit.Models
    [PublicPage("ContentPage", isSEO: true)]
    [Parent("Content Management")]
    public class ContentPageModel : DPPublicNavigationPageModel, IDPModel
        public ContentPageModel Parent { get; set; }
You can see that this class doesn't include Title and Description. It’s default attributes. Now that we have our data model we can turn our attention to the ContentPage view.
@using Nop.Web.Framework.UI;
@using DevPartner.Nop.Plugin.Core.Models.CMS;

@model  DPPublicNavigationPageModel
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";


    if (!string.IsNullOrEmpty((string)Model.MetaTitle))
        Html.AddHeadCustomParts("<meta name=\"title\" content=\"" + (string)Model.MetaTitle + "\" />");
        Html.AddHeadCustomParts("<meta name=\"title\" content=\"" + (string)Model.Name + "\" />");
    Html.AddHeadCustomParts("<meta name=\"date\" content=\"" + DateTime.Now.ToString(" yyyy-MM-dd") + "\" scheme=\"YYYY-MM-DD\"  />");

@section Breadcrumb
    @Html.Action("Breadcrumb", "DevPartnerCommon", new { entityId = Model.Id, includeFolderEntities = false })

@section left
    @Html.Action("ChildEntitiesNavigation", "DPPublicPage", new { entityId = Model.Id })
    @Html.Action("ManufacturerNavigation", "Catalog")
    @Html.Action("VendorNavigation", "Catalog")
    @Html.Action("RecentlyViewedProductsBlock", "Product", new { productThumbPictureSize = 64 })
    @Html.Action("PopularProductTags", "Catalog")
    @Html.Action("PollBlock", "Poll", new { systemKeyword = "LeftColumnPoll" })

<div class="content-page">
    <div class="content-wrapper">

        <div class="content-head">
            <div class="content-title">
        <div class="text-body">
            @Html.Raw(Model.Text as string)
The last step will be connecting our model with our public view. We can do it by replacing Install method in our plug-in file with the following snipet

        public override void Install()
            var pageContentPage = new PublicPageModel { Name = "ContentPage", Path= "DP_ContentPage" };
            _entityModelService.SaveEntity(pageContentPage, EntityTypes.PublicPage.Id);

            //save new cms entities

Very quickly and without any special admin code we have been able to create new content type with public page view based our strongly data model.