Includable templates
From VYRE
From Unify 4.4 XSL Includable templates stylesheets can be created to be used in other XSL stylesheets. This is useful when you are using common XSL functions or parameters that can be used in multiple XSL stylesheets.
Includable templates can be found under Files/XSL within the Publishing module (Figure 1). Creation of XSL is the same as other XSL folder sections such as Item List. You can create the XSL folder or XSl stylesheet by using the Create XSL folder or Create buttons from the top contextual menu repectively.
Includable templates section in Unify4.4 exists to contain XSL to be included in different XSL's. For example Velocity and XSL paramaters are used often within XSL stylesheets.
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="utf-8"/> <!-- Params --> <xsl:param name="context_path"/> <xsl:param name="current_path"/> </xsl:stylesheet>
Since these parameters are used in multiple XSl stylesheets, a 'Parameters' XSL stylesheet containing various XSl parameters can be created.
The 'Parameters' file will look similar to this:
<!-- Path related params --> <xsl:param name="context_path"/> <xsl:param name="current_path"/> <!-- Date related params--> <xsl:param name="current_day"/> <xsl:param name="current_month"/> ...
Using xsl:include method in other XSl stylesheets 'Parameters' file can be referred/included.
TIP: When using an included file that contains parameters, you cannot have the same parameters in the file referring to it. For example in our 'Parameters' file we have context_path parameter. The context_path parameter cannot be used in the file using xsl:include method. If used you will essentially have two identical parameters and saving the file with xsl:include method will throw an error.
NOTE: If XSL caching/pre-compiling is turned on then to see any changes in your stylesheet using the xsl:include, you will have to first deploy the included XSL file. To view changes in the vyre4 back-end save any file using xsl:include, or to view in the front-end then deploy any file using xsl:include.

