#7 CmsContext.View – ID, Identifier, Edition, Name, etc.
Interface ICmsView
Get information about the view context.
Output
The .Edition attribute:
Get information about the edition used (otherwise it returns an empty string):
<h3>The .Edition attribute:</h3>
Get information about the edition used (otherwise it returns an empty string):
<strong>
@CmsContext.View.Edition
</strong>
Output
The .Id attribute:
Get the id of the view configuration:
33796
<h3>The .Id attribute:</h3>
Get the id of the view configuration:
<strong>
@CmsContext.View.Id
</strong>
Output
The .Identifier attribute:
An optional identifier which the View configuration can provide.
Use this when you want to use the same template but make minor changes based on the View selected (like change the number of columns).
Usually you will use either this OR the Settings:
<h3>The .Identifier attribute:</h3>
An optional identifier which the View configuration can provide.
Use this when you want to use the same template but make minor changes based on the View selected (like change the number of columns).
Usually you will use either this OR the Settings:
<strong>
@CmsContext.View.Identifier
</strong>
Output
The .Name attribute:
Name of the view as configured - note that because of i18n it could be different depending on the language.
To clearly identify a view, use the Identifier or use Settings:
C170 View
<h3>The .Name attribute:</h3>
Name of the view as configured - note that because of i18n it could be different depending on the language.
To clearly identify a view, use the Identifier or use Settings:
<strong>
@CmsContext.View.Name
</strong>
#7 CmsContext.View – ID, Identifier, Edition, Name, etc.
@inherits Custom.Hybrid.Razor14
@using ToSic.Razor.Blade;
<!-- unimportant stuff, hidden -->
<div @Sys.PageParts.InfoWrapper()>
@Html.Partial("../shared/DefaultInfoSection.cshtml")
<div @Sys.PageParts.InfoIntro()>
<h2>Interface ICmsView</h2>
<p>
Get information about the view context.
</p>
</div>
</div>
<h3>The .Edition attribute:</h3>
Get information about the edition used (otherwise it returns an empty string):
<strong>
@CmsContext.View.Edition
</strong>
<h3>The .Id attribute:</h3>
Get the id of the view configuration:
<strong>
@CmsContext.View.Id
</strong>
<h3>The .Identifier attribute:</h3>
An optional identifier which the View configuration can provide.
Use this when you want to use the same template but make minor changes based on the View selected (like change the number of columns).
Usually you will use either this OR the Settings:
<strong>
@CmsContext.View.Identifier
</strong>
<h3>The .Name attribute:</h3>
Name of the view as configured - note that because of i18n it could be different depending on the language.
To clearly identify a view, use the Identifier or use Settings:
<strong>
@CmsContext.View.Name
</strong>
@* Footer *@
@Html.Partial("../Shared/Layout/FooterWithSource.cshtml", new { Sys = Sys })