Skip to main content
Home  › ... Razor

CmsContext Tutorials

Tutorial HomeCmsContext

Interface ICmsPlatform

With this object you can get general information about the current platform.

Output

The .Name attribute:

The current platform name is: Dnn
<h3>The .Name attribute:</h3>
The current platform name is: 
<strong>
  @CmsContext.Platform.Name
</strong>

Output

The .Type attribute:

The current platform type is: Dnn
<h3>The .Type attribute:</h3>
The current platform type is: 
<strong>
  @CmsContext.Platform.Type
</strong>

Output

The .Version attribute:

The current platform version is: 9.11.0.46
<h3>The .Version attribute:</h3>
The current platform version is: 
<strong>
  @CmsContext.Platform.Version
</strong>

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.Razor14
@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>
    </div>
  </div>

  <h3>The .Name attribute:</h3>
  The current platform name is: 
  <strong>
    @CmsContext.Platform.Name
  </strong>


  <h3>The .Type attribute:</h3>
  The current platform type is: 
  <strong>
    @CmsContext.Platform.Type
  </strong>


  <h3>The .Version attribute:</h3>
  The current platform version is: 
  <strong>
    @CmsContext.Platform.Version
  </strong>


@* Footer *@
@Html.Partial("../Shared/Layout/FooterWithSource.cshtml", new { Sys = Sys })