To import XSL from other XSL sites, use the :

<xsl:import href="..." />

It is of course possible to add a relative path such as [maXslVoisine].xsl to retrieve nearby files.

However, for some files it is recommended to use protocols for simple retrieval of the XSL files, and to be able to retrieve them from several possible locations.

No protocol

When there is no protocol, the file path is relative.

<xsl:import href="commons/menus.xsl" />

skin

By adding the skinprotocol, it's possible to fetch any file in the current graphic charter using a path relative to the root of the cms/skins/[skinName]/ folder.

<xsl:import href="skin://stylesheets/menus.xsl" />

template

The template protocol is used to retrieve a file in a given template in the current graphics charter. The path must correspond to the path of the cms/skins/[skinName]/templates/[templateName]/ folder.

In this form, the template protocol returns the current template file in the current graphic charter:

<xsl:import href="template://stylesheets/menus.xsl" />

Here, as before, except that if there is no current template, the page template file is automatically returned:

<xsl:import href="template:#page://stylesheets/menus.xsl" />

Finally, this example forces the template to be used, which can be useful for inheriting a new template from another and adding a few subtleties:

<xsl:import href="template:page://stylesheets/menus.xsl" />

plugin

The protocol plugin protocol is used to retrieve a XSL from a given plugin . If plugin does not exist or is not present, an error will occur. The expected path must start from the root of plugin.

<xsl:import href="plugin:web://stylesheets/utils.xsl"/>

service

When using the service protocol, CMS searches for files in the following order:

  1. in the template currently in use, in the cms/skins/[skinName]/templates/[templateName]/stylesheets/services/[pluginName]/ folder,
  2. in the current graphic charter, or in the cms/skins/[skinName]/services/[pluginName]/ folder,
  3. at plugin : plugin:PLUGIN://PATH_TO_THE_FILE.

view

When using the view protocol, CMS searches for files in the following order:

  1. in the current graphic charter skin://,
  2. at plugin Web plugin:web://,
  3. in configuration parameters WEB-INF/param/view/
  4. using view:pluginName://, in the plugin file concerned
  5. at plugin CMS plugin:cms://

If plugin Web is not present, the protocol does not look at the graphic design or plugin Web.

docbookenhancement

This protocol is only used for overloading a few documents, ideally using the demo layout as an example. In particular, it is used to overload docbook2html.xsl, which transforms rich content into HTML. This protocol is a concatenation of several files according to the plugins activated in the project: CMS (with all classic elements), forms (with elements specific to forms), inlinemedia (with media objects), etc. When overloading any element of docbook2html. When overloading any element of docbook2html.xsl, you must :

  • create the stylesheets/io/docbook2html file in the graphic charter. xsl
  • import docbookenhancement://docbook2html.xsl
  • and it is strongly recommended to add a priority to each overloaded template to avoid any conflict.
Back to top