#3 CmsContext.Site – Name, URL etc.
Interface ICmsSite
With this object you can get general informtion about the current site.
Output
The .Id attribute:
The id of the current site (this is the same as PortalId
in DNN):
24
<h3>The .Id attribute:</h3>
The id of the current site (this is the same as <code>PortalId</code> in DNN):
<strong>
@CmsContext.Site.Id
</strong>
Output
The .Url attribute:
The the site url with protocol:
https://2sxc.org/dnn-tutorials/en
<h3>The .Url attribute:</h3>
The the site url with protocol:
<strong>
@CmsContext.Site.Url
</strong>
Output
The .UrlRoot attribute:
The the site url without a protocol:
2sxc.org/dnn-tutorials/en
<h3>The .UrlRoot attribute:</h3>
The the site url without a protocol:
<strong>
@CmsContext.Site.UrlRoot
</strong>
#3 CmsContext.Site – Name, URL 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 ICmsSite</h2>
<p>
With this object you can get general informtion about the current site.
</p>
</div>
</div>
<h3>The .Id attribute:</h3>
The id of the current site (this is the same as <code>PortalId</code> in DNN):
<strong>
@CmsContext.Site.Id
</strong>
<h3>The .Url attribute:</h3>
The the site url with protocol:
<strong>
@CmsContext.Site.Url
</strong>
<h3>The .UrlRoot attribute:</h3>
The the site url without a protocol:
<strong>
@CmsContext.Site.UrlRoot
</strong>
@* Footer *@
@Html.Partial("../Shared/Layout/FooterWithSource.cshtml", new { Sys = Sys })