To facilitate the integration of a graphic charter, a number of XSLT variables are available from XSLT files.
These variables are defined in the variables file.xsl of the "web" workspace:
Variable | Description |
---|---|
$uri-prefix | Application context according to rendering context. Ex: '/cms', '/cms/preview'. See AmetysXSLTHelper.uriPrefix() |
$site-uri-prefix |
Context of current site according to rendering context/ |
$absolute-uri-prefix | Same as $uriPrefix but with absoluteurl . Ex:'http://www.ametys.org/cms/' or'http://www.ametys.org/cms/preview/ See AmetysXSLTHelper.absoluteUriPrefix() |
$absolute-site-uri-prefix | Same as $siteUriPrefix but with the absoluteurl . Ex:'http://www.ametys.org' or'http://www.ametys.org/cms/www' or'http://www.ametys.org/cms/preview/www' See AmetysXSLTHelper.absoluteSiteUriPrefix()) |
$page-path | Path of the current page. The path is relative to the sitemap. Ex: "rubrique/sous-rubrique/page" See AmetysXSLTHelper.pagePath() |
$page-id | Unique identifier of the current page (in the form page://...) See AmetysXSLTHelper.pageId() |
$lang | Language code of the current page Ex: fr, en, es, ... See AmetysXSLTHelper.lang() |
$site | Current site name. Ex: "www", "default", "medecine", ... See AmetysXSLTHelper.site() |
$skin |
Name of the skin used by the current site |
$template | Name of the template currently in use, i.e. the current page Ex: "page", "index", ... See AmetysXSLTHelper.template() |
$zone |
Name of zone being rendered (content or service) with 'default' as default value if rendering is not in a zone From Ametys 4.2 |
$rendering-context | Current rendering context :
|
Link to home page (index page)
<a href="{$site-uri-prefix}/{$lang}/index.html">Accueil</a>
Disabling a feature in the back office
<xsl:choose> <xsl:when test="$rendering-context = 'back'"> <xsl:text>javascript:alert("Cette fonctionnalité ne peut pas être utilisée dans le back-office. Ouvrez la prévisualisation pour l'utiliser.");</xsl:text> </xsl:when test> <xsl:otherwise> ... </xsl:otherwise> </xsl:choose>
Translation of a i18n key from the skin
<head> <title><i18n:text i18n:key="SKIN_TITLE" i18n:catalogue="skin.{$skin}"/></title> ... </head>