Header / @Header Object
The Header is a Dynamic Entity in all Dynamic Code (Razor and WebAPI).
It's used on Views which are configured to have lists - and allows you to add information for the header or similar. So basicall List-Views have 0 or 1 Header and 0 or many Content items.
If the View is not a list, the Header will not be available.
⚡ The official API docs.
Since it's a Dynamic Entity it carries all values as properties, like
Discover More in the Razor Tutorials
We have an rich series of Razor tutorials. You should really check them out 👍.
Example Razor Code
<h2> @Header.Title </h2>
Depending on the view configuration the Header can carry additional presentation information, for example how to format the title etc. This is available on
Header.Presentation. The Presentation object is also a Dynamic Entity.
<h2 class="@Header.Presentation.Highlight"> @Header.Title </h2>
Note that the View can be configured to contain demo data for both the Header as well as the Header.Presentation. In this case your template will receive data to show even if the editor has not added anything.
- Introduced in 2sxc 1.0 under the name
Listwhich was confusing
- Changed to
Headerin ca. V10 (but List still works for compatibility)
- Presentation added in this documented form ca. 2sxc 8