The 5.7 branch of Magnolia reached End-of-Life on December 31, 2023, as specified in our End-of-life policy. This means the 5.7 branch is no longer maintained or supported. Please upgrade to the latest Magnolia release. By upgrading, you will get the latest release of Magnolia featuring significant improvements to the author and developer experience. For a successful upgrade, please consult our Magnolia 6.2 documentation. If you need help, please contact info@magnolia-cms.com.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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))]
  • No labels