uri.image

Resizes a given image (if required) and returns its relative path.

Examples

Default:

<f:uri.image src="EXT:myext/Resources/Public/typo3_logo.png" />

Output:

typo3conf/ext/myext/Resources/Public/typo3_logo.png

or (in BE mode):

../typo3conf/ext/myext/Resources/Public/typo3_logo.png

Image Object:

<f:uri.image image="{imageObject}" />

Output:

fileadmin/images/image.png

or (in BE mode):

fileadmin/images/image.png

Inline notation:

{f:uri.image(src: 'EXT:myext/Resources/Public/typo3_logo.png', minWidth: 30, maxWidth: 40)}

Output:

typo3temp/assets/images/[b4c0e7ed5c].png

(depending on your TYPO3s encryption key)

non existing image:

<f:uri.image src="NonExistingImage.png" />

Output:

Could not get image resource for "NonExistingImage.png".

Arguments

src

DataType
string
Required
true
Description
Src

treatIdAsReference

DataType
mixed
Required
true
Description
Given src argument is a sys_file_reference record

image

DataType
mixed
Required
true
Description
Image

crop

DataType
mixed
Required
true
Description
Overrule cropping of image (setting to FALSE disables the cropping set in FileReference)

cropVariant

DataType
string
Default
‘default’
Required
true
Description
Select a cropping variant, in case multiple croppings have been specified or stored in FileReference

width

DataType
string
Required
true
Description
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.

height

DataType
string
Required
true
Description
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.

minWidth

DataType
mixed
Required
true
Description
Minimum width of the image

minHeight

DataType
mixed
Required
true
Description
Minimum height of the image

maxWidth

DataType
mixed
Required
true
Description
Maximum width of the image

maxHeight

DataType
mixed
Required
true
Description
Maximum height of the image

absolute

DataType
mixed
Required
true
Description
Force absolute URL