Uri.image ViewHelper <lim:uri.image> 

This ViewHelper generate an uri for the given image.

Examples 

<picture>
    <lim:uri.image
        treatIdAsReference="true"
        src="{image.uid}"
        alt="{image.alternative}"
        width="600"
        height="400"
        cropVariant="pasteHereYourCropVariant"
        imageServerOptions="{fm: 'pjpg', q: 'lossless'}"
        passThrough="true"
    />
</picture>
Copied!

To use the cropping add a m to the width and the height. It looks like this.

<picture>
    <lim:uri.image
        treatIdAsReference="true"
        src="{image.uid}"
        alt="{image.alternative}"
        width="600m"
        height="400m"
        cropVariant="pasteHereYourCropVariant"
        imageServerOptions="{fm: 'pjpg', q: 'lossless'}"
        passThrough="true"
    />
</picture>
Copied!

You can also use this ViewHelper as inline notation.

<picture>
    {lim:uri.image(treatIdAsReference: true, src: image.id, alt: image.alternative, width: '600c', height: '400c', cropVariant: 'pasteHereYourCropVariant', imageServerOptions: '{fm: "pjpg", q: "lossless"}', passThrough: true)}
</picture>
Copied!

Arguments

The following arguments are available for the uri.image ViewHelper:

absolute

absolute
Type
bool
Default
false
Force absolute URL

crop

crop
Type
string|bool
If you want to deactivate cropping of the image, set this attribute to `true`

cropVariant

cropVariant
Type
string
Default
'default'
If you have defined multiple cropping variants enter here the cropping variant you want to use for the cropping of your image.

fileExtension

fileExtension
Type
string
Custom file extension to use

height

height
Type
string
height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options. "auto" derives the height from the ratio of the crop variant (or of the whole image) at the given numeric width; only for FAL images.

image

image
Type
object
a FAL object (\TYPO3\CMS\Core\Resource\File or \TYPO3\CMS\Core\Resource\FileReference)

imageServerOptions

imageServerOptions
Type
array
Default
array ( )
Imageserver related options to be passed to. You can pass any valid Imageserver option. This options will overrule all other defined attributes

liaContext

liaContext
Type
array
Default
array ( )
Opaque context for ModifyProcessingInstructionsEvent listeners, e.g. {aiBadge: '0'}. Never forwarded to the image server.

maxHeight

maxHeight
Type
int
maximum height of the image

maxWidth

maxWidth
Type
int
maximum width of the image

minHeight

minHeight
Type
int
minimum height of the image

minWidth

minWidth
Type
int
minimum width of the image

passThrough

passThrough
Type
boolean
Default
false
If you have to skip the imageserver set this argument to `true`.

src

src
Type
string
Default
''
Here goes the source of the image. It can be the uid of it or a relative or absolute path to the image.

treatIdAsReference

treatIdAsReference
Type
bool
Default
false
If you use an UID in the `src` attribute you have to set this argument to `true` to get an result.

width

width
Type
string
width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options. "auto" derives the width from the ratio of the crop variant (or of the whole image) at the given numeric height; only for FAL images.