#1 CmsContext.Platform – Dnn/Oqtane, Version etc.
Requirements
Resources
Interface ICmsPlatform
With this object you can get general information about the current platform.
On the new RazorPro
it's on MyContext.Platform
.
On the older Razor14
or Razor12
it's on CmsContext.Platform
.
Output
-
.Name
Current platform name is: Oqtane -
.Type
Current platform type is: Oqtane -
.Version
Current platform version is: 4.0.2
#1 CmsContext.Platform – Dnn/Oqtane, Version etc.
Source Code of this file
Below you'll see the source code of the file. Note that we're just showing the main part, and hiding some parts of the file which are not relevant for understanding the essentials. Click to expand the code
@inherits Custom.Hybrid.RazorTyped @using ToSic.Razor.Blade; <!-- unimportant stuff, hidden --> <div @Sys.PageParts.InfoWrapper()> @Html.Partial("../shared/DefaultInfoSection.cshtml") <div @Sys.PageParts.InfoIntro()> <h2>Interface ICmsPlatform</h2> <p> With this object you can get general information about the current platform. </p> <p>On the new <code>RazorPro</code> it's on <code>MyContext.Platform</code>.</p> <p>On the older <code>Razor14</code> or <code>Razor12</code> it's on <code>CmsContext.Platform</code>.</p> </div> </div> <ol> <li> <code>.Name</code> Current platform name is: <strong>@MyContext.Platform.Name</strong> </li> <li> <code>.Type</code> Current platform type is: <strong>@MyContext.Platform.Type</strong> </li> <li> <code>.Version</code> Current platform version is: <strong>@MyContext.Platform.Version</strong> </li> </ol> @* Snippet for the old v14 code, which shouldn't run but should be shown. This is a bit of a hack, but it works <ol> <li> <code>.Name</code> Current platform name is: <strong>@CmsContext.Platform.Name</strong> </li> <li> <code>.Type</code> Current platform type is: <strong>@CmsContext.Platform.Type</strong> </li> <li> <code>.Version</code> Current platform version is: <strong>@CmsContext.Platform.Version</strong> </li> </ol> *@ @* Footer *@ @Html.Partial("../Shared/Layout/FooterWithSource.cshtml", new { Sys = Sys })