Content Views
Content Views are the website pages, the views the user sees on the front end of the website and where you put all your HTML / styling etc.
Last updated
Content Views are the website pages, the views the user sees on the front end of the website and where you put all your HTML / styling etc.
Last updated
public interface IContentView
{
/// <summary>
/// The Content that the View uses
/// </summary>
Models.Content? Content { get; set; }
/// <summary>
/// Language dicts for the currently set language
/// </summary>
Dictionary<string, string>? LanguageKeys { get; set; }
}@using ZauberCMS.Web.Layouts
@implements ZauberCMS.Core.Content.Interfaces.IContentView
@* IMPORTANT: You must always set the layout you want to use, ZauberCMS expects one *@
@layout MainLayout
@* Pulling out the value of a textbox property by it's alias PageTitle *@
@* IContentViews use the default App.Razor built into ZauberCMS *@
@* So to get data into the <head> you can use two different ways *@
@* First way, is to use the built in Blazor PageTitle component *@
<PageTitle>@(Content!.GetValue<string>("PageTitle"))</PageTitle>
@* Pulling out the value of a textarea property by it's alias MetaDescription *@
@* Second way to get data into the head is to use SectionContent which is a Blazor feature *@
<SectionContent SectionId="MainLayout.Sections.PageHeadContent">
<meta name="description" content="@(Content!.GetValue<string>("MetaDescription"))">
</SectionContent>
@* Pulling out the value of a textbox property by it's alias Heading *@
<h1>@(Content!.GetValue<string>("Heading"))</h1>
@* Pulling out the value from the Radzen rich text editor property by it's alias Content *@
<div class="maincontent">
@((MarkupString)(Content!.GetValue<string>("Content") ?? string.Empty))
</div>
@code {
[Parameter] public Content? Content { get; set; }
[Parameter] public Dictionary<string, string>? LanguageKeys { get; set; }
}@rendermode InteractiveServer