image.path

string main(string imageName, int maxX, int maxY)

Returns the url path to the image with given maxX and maxY dimensions.

Usage

This macro is mainly used for embedding images into content pages for banners, etc. If images are dynamic like product images or user images in the editor the returned url is created on client side with using the uuid of the image.

Example

The returned image will request the image with the name "logo" with maximum dimensions of 400x400 where it is fit into. The image dimensions returned might be something like 400x237 or 125x400

...
<!-- image in max boundaries of 400x300 -->
<img src="#{image.path('logo', 400, 300)}">

<!-- image in square boundaries of 400x400 -->
<img src="#{image.path('logo', 400)}">

<!-- image in original size -->
<img src="#{image.path('logo')}">
 ...


Parameter string imageName

args[0] - name of the file content

Parameter int maxX

args[1] - maximum width of the image

Parameter int maxY

args[2] - maximum height of the image

Returns string

relative url path or null