Interface ICmsSite
The site context of the code - so basically which website / portal it's running on.
🪒 In Dynamic Razor it's found on CmsContext.Site
🪒 In Typed Razor it's found on MyContext.Site
[PublicApi]
public interface ICmsSite : IHasMetadata
Properties
Id
The Id of the site in systems like DNN and Oqtane.
🪒 Use in Dynamic Razor: CmsContext.Site.Id
🪒 Use in Typed Razor: MyContext.Site.Name
int Id { get; }
Property Value
Remarks
In DNN this is the same as the PortalId
Metadata
Metadata of the current site
[JsonIgnore]
IMetadata Metadata { get; }
Property Value
Remarks
Added in v13.12
Url
The site url with protocol. Can be variation of any such examples:
- https://website.org
- https://www.website.org
- https://website.org/products
- https://website.org/en-us
- https://website.org/products/en-us
🪒 Use in Dynamic Razor: CmsContext.Site.Url
🪒 Use in Typed Razor: MyContext.Site.Url
string Url { get; }
Property Value
UrlRoot
The url root which identifies the current site / portal as is. It does not contain a protocol, but can contain subfolders. This is mainly used to clearly identify a site in a multi-site system or a language-variation in a multi-language setup.
🪒 Use in Dynamic Razor: CmsContext.Site.UrlRoot
🪒 Use in Typed Razor: MyContext.Site.UrlRoot
string UrlRoot { get; }
Property Value
Remarks
introduced in 2sxc 13