Contribute to Docs Contribute to Docs

Site Helper

The SiteHelper provides information regarding the active site for the current request.

Properties

Id
@WebApp.Site.Id

Gets the id for the current site.

LanguageId
@WebApp.Site.LanguageId

Gets the LanguageId for the current site.

Culture
@WebApp.Site.Culture

Gets the Culture for the language selected for the current site.

SitePrefix
@WebApp.Site.SitePrefix

Gets the optional site prefix of the current site if it is routed with host/prefix.

Description
@WebApp.Site.Description.Title
@WebApp.Site.Description.Body
@WebApp.Site.Description.Logo

Gets the standard description fields available for the site.

Sitemap
var sitemap = WebApp.Site.Sitemap;

Gets the Sitemap for the current site. This can for example be used for rendering menus. The result only contains the currently published nodes, but hidden nodes are included and must be handled by the application.

Methods

GetContentAsync
var content = await WebApp.Site.GetContentAsync<T>();

Gets the current site content with the specified Site Type. This is used if you have registered and selected a Type for your site for Site Global Content.