Document Tree
Document Properties
Kbid
2477D8
Last Modified
04-Feb-2020
Added to KB
20-Jun-2013
Public Access
Everyone
Status
Online
Doc Type
References
Product
  • ICM 7.10
  • ICM 11
  • ICM 12
ISML Function - ContentURL()

Name

ContentURL()

Short Description

reference static content in the static content directory of the current unit

Table of Contents

Product Version

6.5

Product To Version

 

StatusNew Labels

Introduction

The ContentURL() function is used to reference static content in the static content directory of the current unit, e.g., share/sites/<site_name>/<version-id>/static/units/<unit_name>/static.

Syntax

ContentURL(<contentRef>)
ContentURL(<contentRef>, [<locale>])
ContentURL(<contentRef>, [<locale>], [<servergroup>])

Example

The following example shows how to reference an image of an offer within a unit:

<img src=#ContentURL(Product:OfferedProduct:Image)#>

When the template is processed, the content reference replaces the ISML expression Product:OfferedProduct:Image. You can reference a product image with or without mentioning the unit it belongs to (e.g., Officeland:/images/calc.gif or /images/calc.gif). This is shown below, along with the possibility to provide a locale ID:

<img src=#ContentURL('images/calc.gif', 'de_DE')#>

In the example, the ISML function ContentURL() parses the string parameter given in brackets to extract unit and path names, and produces the following URL:

/is-bin/intershop.static/<group>/<current_site>/-/<locale>/images/calc.gif

The abstract result of the ContentURL() function parsing the string parameter is the following:

<WebRoot_url>/<group>/<site>/<unit>/<locale>/<path>

Unit and path names are separated by a colon, as shown below:

<unit_name>:<path>

For example, the following reference

<a href="#ContentURL('PrimeTech:zips/p4366a.zip','de_DE')#">

is resolved to

http:// <>/is-bin/intershop.static/WFS/PrimeTech-PrimeTechSpecials-Site/…PrimeTech/de_DE/zips/p4366a.zip

The elements of this URL are explained in Table below.
Web Root Elements

URL Element

Description

<WebRoot_url>

Specified by the property intershop.template.(Https)WebRootURL, the default value of which is /is-bin/intershop.static(see the appserver.properties file).

<group>

Server group

<site>

Current site

<unit>

Unit specified by the ContentURL parameter

<locale>

Locale specified by the ContentURL parameter. If no locale is provided, the fallback described above is used.

<path>

Resource path; Intershop 7 business objects (e.g., Products) hold relative paths to the static content that is assigned to them. The syntax of such a path name is <unit_name>:<path>.

Parameters

content reference

The content reference is a required parameter that references static content (e.g., /images/calc.gif).

locale

This optional parameter can be used to override the default locale. If left unspecified, the following fallback is used:

  1. the request's current locale
  2. the lead locale
  3. the locale will be designated as a missing parameter -

servergroup

This optional parameter can be used to override the default server group. If left unspecified, the first value from the application server property intershop.server.assignedToServerGroup is used.

Reference - ISML Functions

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.
The Intershop Knowledge Portal uses only technically necessary cookies. We do not track visitors or have visitors tracked by 3rd parties. Please find further information on privacy in the Intershop Privacy Policy and Legal Notice.
Home
Knowledge Base
Product Releases
Log on to continue
This Knowledge Base document is reserved for registered customers.
Log on with your Intershop Entra ID to continue.
Write an email to supportadmin@intershop.de if you experience login issues,
or if you want to register as customer.