Variables

.id

Unique ID of the image. Cannot be changed.

TYPE
numeric
CONSTRAINTS
>= 1
PRESENCE
always

Examples

CODE{{ image.id }}
OUTPUT1234

.alt

Alternative text to display when images are disabled in the viewer's browser. This is normally used for the img tag, alt attribute. Changeable under Photo » Alternate.

TYPE
string
CONSTRAINTS
up to 128 characters
PRESENCE
always, but can be blank

Examples

CODE{{ image.alt }}
OUTPUTHP LaserJet CP1525n Front Photo

.notes

Optional notes for the image, as configured under Photo » Notes.

TYPE
string
CONSTRAINTS
up to 128 characters
PRESENCE
always, but can be blank

Examples

CODE{{ image.notes }}
OUTPUTProduct may differ from photo.

.src

Image source URL of the original non re-scaled image, that can be used as a value for the img tag, src attribute.

TYPE
relative URL
CONSTRAINTS
valid URL
PRESENCE
always

Examples

CODE{{ image.src }}
OUTPUT/files/gallery/00/00/00/00000007.jpg

.variants

List of variant objects available for the image. Variants are scaled down versions of the original image. There are two ways to access an image variants. The typical way is by its reference name as configured in the variant configuration. For example, variants can have reference names such as small, medium and large. To access the small variant, use image.variants.small. Alternatively, you can iterate over all available variants.

TYPE
object
CONSTRAINTS
n/a
PRESENCE
always, but could be zero-length

Examples

CODE{% for variant in image.variants %}
{{ variant.id }} |
{{ variant.ref }} |
{{ variant.src }} |
{{ variant.max_width }} |
{{ variant.max_height }}<br/>
{% endif %}
OUTPUT1234 | small | /files/gallery/00/00/00/00000007_small.jpg | 80 | 80
1235 | medium | /files/gallery/00/00/00/00000007_medium.jpg | 160 | 160
1236 | large | /files/gallery/00/00/00/00000007_large.jpg | 400 | 400


variant Variables

.src

Image source URL, that can be used as a value for the img tag, src attribute.

TYPE
relative URL
CONSTRAINTS
valid URL
PRESENCE
always

Examples

CODE{{ image.variants.medium.src }}
OUTPUT/files/gallery/00/00/00/00000007_medium.jpg

.ref

Variant reference name, as configured in the variant configuration.

TYPE
reference
CONSTRAINTS
alphanumeric, dashes and underscores
PRESENCE
always

Examples

CODE{{ image.variants.medium.ref }}
OUTPUTmedium

.max_width

Maximum width of the image. Since all re-scaling preserves the original image aspect ratio, in cases where the original image and variant configration have different aspect ratio, the re-scaling results in either the width or the height of the variant becoming less than the maximum for the variant.

TYPE
numeric
CONSTRAINTS
1 - 10000
PRESENCE
always

Examples

CODE{{ image.variants.medium.max_width }}
OUTPUT400

.min_width

Minimum width of the image. Since all re-scaling preserves the original image aspect ratio, in cases where the original image and variant configration have different aspect ratio, the re-scaling results in either the width or the height of the variant becoming less than the maximum for the variant.

TYPE
numeric
CONSTRAINTS
1 - 10000
PRESENCE
always

Examples

CODE{{ image.variants.medium.min_width }}
OUTPUT400