ISML Tag - ISFILEBUNDLE (valid to 7.9)

Name

ISFILEBUNDLE

Short Description

bundles small source files

Table of Contents

Product Version

6.5

Product To Version

7.9

Status

final

1 Introduction

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.

2 Configuration

The behavior of the <ISFILEBUNDLE> tag depends on following properties listed in <IS.INSTANCE.SHARE>/system/config/cluster/appserver.properties:

Property

Default Value

Description

intershop.template.isfilebundle.CheckSource

false

If set to true the <ISFILEBUNDLE> tag checks during every request if the corresponding ISML files, the JavaScript files or the CSS files are out of date. The corresponding file will be processed and bundled again if this file is out of date. This process can lead to performance problems in live systems. So this property should be set to false for such systems.

intershop.template.isfilebundle.Combine

true

The <ISFILEBUNDLE> tag bundles one or more files of the same type to one big file.

intershop.template.isfilebundle.Process

true

The <ISFILEBUNDLE> tag executes the configured processors. In most cases, this is a compressor which minimizes the given files by removing white spaces and comments.

3 Syntax

<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>

4 Example

<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>

5 Attribute

5.1 name

This attribute is required.
name = relative target path

Specifies the relative path to the bundled file.

5.2 processors

This attribute is required.
processors = comma separated default processor list

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
    Minimizes a CSS file.
  • JSCompressor
    Minimizes a JavaScript file.
  • SemicolonAppender
    Appends a semicolon (";") to the end of each file. Normally there is no need to do this. But for bundling of some JavaScript files it is necessary to add a ";" at the end of the file. It is recommended to fix this issue in the files directly instead of using this SemicolonAppender.

Reference - ISML Tags

Disclaimer

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.

Customer Support
Knowledge Base
Product Resources
Support Tickets