Magnolia 5.7 reached extended end of life on May 31, 2022. Support for this branch is limited, see End-of-life policy. Please note that to cover the extra maintenance effort, this EEoL period is a paid extension in the life of the branch. Customers who opt for the extended maintenance will need a new license key to run future versions of Magnolia 5.7. If you have any questions or to subscribe to the extended maintenance, please get in touch with your local contact at Magnolia.

sitefn templating functions provide information about the current site. You can access the Site object and the Theme currently applied to the site.

Get the current site

Gets the current Site.

Method signature

Site site()

Arguments

none

Returns

Returns the current Site.

Usage

sitefn.site()

 [#assign mySite=sitefn.site()]

Get the site of the passed content

Gets the Site of the passed content.

Method signature

Site site(ContentMap content)

Arguments

content

required

The content map whose site you want to get.

Returns

Returns the Site of the passed ContentMap.

Usage

sitefn.site(content)

 [#assign currentSite = sitefn.site(content)]

Related functions

Get a site's theme

Gets the Theme of a Site.

Method signature

Theme theme(Site site)

Arguments

site

required

The site whose theme you want to get.

Returns

Returns a site's Theme.

Usage

sitefn.theme(site)

 [#assign currentTheme=sitefn.theme(sitefn.site(content))]