The <ISFILEBUNDLE>
tag allows you to bundle multiple smaller source files into one big file and to configure processors for the bundled files. <ISFILEBUNDLE>
has the two supporting tags <ISFILE>
and <ISRENDER>
.
Each file bundle must have one <ISRENDER>
tag. <ISRENDER>
provides a render method for all resulting files of this file bundle. The variable File:Name
(see example below) is the name of the bundle or the name of one of the configured files.
A file bundle must have one or more <ISFILE>
tags. <ISFILE>
is used to declare files to be processed via its name attribute.
The behavior of the <ISFILEBUNDLE>
tag depends on the following properties listed in <IS.INSTANCE.SHARE>/system/config/cluster/appserver.properties:
Property | Default Value | Description |
---|---|---|
intershop.template.isfilebundle.CheckSource |
| If set to |
intershop.template.isfilebundle.Combine |
| The |
intershop.template.isfilebundle.Process |
| The |
intershop.template.isfilebundle.jsprocessor | yui | Defines which JavaScript processor is used. The value 'yui' selects the YUICompressor (deprecated, some modern JavaScript features are not supported), 'closure ' selects the Google Closure compiler (recommended processor, strictly requires JavaScript). If the property is not defined or contains an invalid value, 'yui' is used as a fallback (since 7.10.16.3). |
<isfilebundle name = "{relative target path}" processors = "{comma separated default processor list}" > <isrender> ... some HTML and ISML code ... </isrender> [ <isfile name = "{relative source path}" [ processors = "{comma separated processor list}" ] /> ] </isfilebundle>
<isfilebundle name="/css/bundles/BundledCSSFile.css" processors="CSSCompressor"> <isrender> <link type="text/css" rel="stylesheet" href="#webRoot().'/'.File:Name#" media="all"> </isrender> <isfile name="/css/CSS_File1.css"/> <isfile name="/css/CSS_File2.css"/> <isfile name="/css/CSS_File3.css"/> <isfile name="/css/CSS_File4.css"/> </isfilebundle> <isfilebundle name="/js/bundles/BundledJSFile.js" processors="JSCompressor, SemicolonAppender"> <isrender> <script src="#webRoot().'/'.File:Name#"></script> </isrender> <isfile name="/js/JS_File1.js"/> <isfile name="/js/JS_File2.js"/> <isfile name="/js/JS_File3.js"/> <isfile name="/js/JS_File4.js"/> </isfilebundle>
name
This attribute is required. name = relative target path
It specifies the relative path to the bundled file.
Note
Make sure that the source file name(s) differ from the bundle target name. Always use different names, otherwise the changes will take no effect.
In case the names are identical, a warn message is printed to the WARN log indicating what needs to be changed.
processors
This attribute is required. processors = comma separated default processor list
It specifies the components that should process the declared files. The values must be a comma-separated list of valid processor names. The processors are executed in reverse order (from last to first).
The following three processors are available:
CSSCompressor
JSCompressor
SemicolonAppender
SemicolonAppender
.The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.