ISML Tag - ISRENDER

Name

ISRENDER

Short Description

renders files of file bundle

Table of Contents

Product Version

6.5

Product To Version


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 attribute File:Name 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 Syntax

All <ISFILEBUNDLE> tags must have one <ISRENDER> tag.
The <ISRENDER> tag provides a render method for all resulting files of this filebundle. This tag is only allowed inside an <ISFILEBUNDLE> tag.

3 Example

The following example shows how to use <ISRENDER>. The URL of the target file consists of the path of the web root and the file name.

<head>
...
  <isfilebundle name="/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_File3.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_File4.js"/>
  </isfilebundle>
...
</head>

The previous example uses only the name for the URL. A web developer may run into browser cache problems. Because the URL does not change when the file content changes. To avoid such problems it is helpful to append the modification date of the target file. Use <ISPRINT> to print the variable lastModified(integer) in the correct format.

...
<head>
...
  <isfilebundle name="/bundles/BundledCSSFile.css" processors="CSSCompressor">
    <isrender>
      <link type="text/css" rel="stylesheet" href="#webRoot().'/'.File:Name?lastModified=<isprint value="#File:LastModified#" formatter="0">#" media="all">
    </isrender>
    <isfile name="/css/CSS_File1.css"/>
    ...
    <isfile name="/css/CSS_File3.css"/>
  </isfilebundle>
...

When the file content changes, the date of the last modification changes too. So the URL will be updated and the web browser can check for the modified files.

4 CSSCompressor

Note

This feature is available from Intershop 7.6. 

The CSSCompressor compresses all CSS file to one file and removes all white-spaces during the process.

You can turn it off via the property intershop.css.compress.enabled=false if you have problems with compressing CSS with arithmetics. See also IS-26670.

It is enabled by default.

5 Attributes

The <ISRENDER> tag provides the attribute File. This attribute is an instance of an implementation from interface com.intershop.beehive.core.capi.resource.Resource.
The File attribute supports the attributes Name and lastModified. Name is the relative path and lastModified is date of the last modification of the target file.

5.1 File:Name

The name of the bundle or the name of one of the configured files.

5.2 File:lastModified

The last date of modification.

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