Interface ICmsView
View context information.
🪒 In Dynamic Razor it's found on CmsContext.View
🪒 In Typed Razor it's found on MyView
Namespace: ToSic.Sxc.Context
Assembly: ToSic.Sxc.dll
Syntax
[PublicApi]
public interface ICmsView : IHasMetadata
Remarks
Added in 2sxc 12.02
Properties
| Improve this Doc View SourceEdition
Edition used - if any. Otherwise empty string.
🪒 Use in Razor: CmsContext.View.Edition
🪒 Use in Typed Razor: MyView.Edition
Declaration
string Edition { get; }
Property Value
Type | Description |
---|---|
string |
Folder
This is the preferred way to get the Url or Path to the current view.
This is different from the App.Folder
, because it will also contain the edition (if there is an edition)
🪒 Use in Razor: CmsContext.View.Folder
- eg CmsContext.View.Folder.Url
🪒 Use in Typed Razor: MyView.Edition
- eg MyView.Folder.Url
Declaration
IFolder Folder { get; }
Property Value
Type | Description |
---|---|
IFolder |
Remarks
Added in v16.04
Id
View configuration ID
🪒 Use in Dynamic Razor: CmsContext.View.Id
🪒 Use in Typed Razor: MyView.Id
Declaration
int Id { get; }
Property Value
Type | Description |
---|---|
int |
Identifier
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
🪒 Use in Razor: CmsContext.View.Identifier
🪒 Use in Typed Razor: MyView.Identifier
Declaration
string Identifier { get; }
Property Value
Type | Description |
---|---|
string |
Metadata
Metadata of the current view
Declaration
IMetadata Metadata { get; }
Property Value
Type | Description |
---|---|
IMetadata |
Remarks
Added in v13.12
Name
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
🪒 Use in Dynamic Razor: CmsContext.View.Name
🪒 Use in Typed Razor: MyView.Name
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |