A style is a colored variation of a template.
The variation is made of images and css files.
First you should set skin tags.
In the skins/skinName/tags/tag.xml file :
<?xml version="1.0" encoding="UTF-8"?> <tags> <category id="STYLES_PAGES"> <label i18n="false">Styles</label> <description i18n="false"></description> <tag id="STYLES_PAGES_BLEU" target="PAGE"> <label i18n="false">Bleu</label> <description i18n="false"></description> </tag> <tag id="STYLES_PAGES_ROUGE" target="PAGE"> <label i18n="false">Rouge</label> <description i18n="false"></description> </tag> </category> </tags>
The tag is in the sitemapinputdata.
To know the style you must find the current page and get back to its first ancestor that has a style (we look for STYLES_PAGES_*)
Add theses lines to your template will create 2 xslt variables
<xsl:variable name="stylePrefix">PLUGIN_TAGS_STYLES_PAGES_</xsl:variable> <xsl:variable name="style" select="substring(name(/cms/inputData/sitemap//page[@sitemap:current='true']/ancestor-or-self::page[@*[starts-with(name(), $stylePrefix)]] [1]/@*[starts-with(name(), $stylePrefix)]), string-length($stylePrefix)+1)"/> <xsl:variable name="stylecontext" select="concat($templatecontext, '/styles/', $style)"/>