Skip to main content

CmsContext Tutorials

Tutorial Home

Interface ICmsCulture

With this object you can get general information about the culture.

The .CurrentCode attribute:

The current code culture is: en-us

1
2
3
4
5
6
<h3>The .CurrentCode attribute:</h3>
The current code culture is:
<strong>
@CmsContext.Culture.CurrentCode
</strong>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The .DefaultCode attribute:

The default culture for the system is: en-us

1
2
3
4
5
6
7
8
9
10
11
12
<h3>The .DefaultCode attribute:</h3>
The default culture for the system is:
<strong>
@if(Text.Has(CmsContext.Culture.DefaultCode)){
@CmsContext.Culture.DefaultCode
} else {
<p>
The system is single language and the response is an empty string.
</p>
}
</strong>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX