f:uri.image

This ViewHelper creates a URI to a given image. If you need a ViewHelper for creating a link, look at vh-link-image.

The created string may not be a fully qualified URI, it may be a relative path.

Properties

src

Variable type
String
Description
Path and file name to the source image. The path must be relative to the project's webroot folder. You can also use paths which feature the EXT: convention.
Mandatory
Either 'this' or 'image' parameter

image

Variable type
Object
Description
An image object.
Mandatory
Either 'this' or 'src' parameter

width

Variable type
String
Description
Width of the image. In addition to a numeric value (pixels), you can also add the suffix “c” or “m” in order to crop or scale the generated image. (Check out the imgResource documentation for details.) Cropping is changed since Typo3 7.2! Use crop="offsetX,offsetY,width,height" to crop images instead of suffix "c". Learn more.
Default value
NULL
Mandatory
No

height

Variable type
String
Description
Height of the image. In addition to a numeric value (pixels), you can also add the suffix “c” or “m” in order to crop or scale the generated image. (Check out the imgResource documentation for details.) Cropping is changed since Typo3 7.2! Use crop="offsetX,offsetY,width,height" to crop images instead of suffix "c". Learn more.
Default value
NULL
Mandatory
No

crop

Variable type
anySimpleType
Description
Overrule cropping of image (setting to FALSE disables the cropping set in FileReference)
Default value
NULL
Mandatory
No

cropVariant

Variable type
string
Description
Select a cropping variant, in case multiple croppings have been specified or stored in FileReference
Default value
'default'
Mandatory
No

minWidth

Variable type
Integer
Description
A minimum width for the generated image, in pixels. Smaller images will be scaled up, as long as the Install Tool setting [GFX][im_noScaleUp] isn't activated.
Default value
NULL
Mandatory
No

minHeight

Variable type
Integer
Description
A minimum height for the generated image, in pixels. Smaller images will be scaled up, as long as the Install Tool setting [GFX][im_noScaleUp] isn't activated.
Default value
NULL
Mandatory
No

maxWidth

Variable type
Integer
Description
Maximum width for the generated image. If the source image is wider than this value, it will be scaled down.
Default value
NULL
Mandatory
No

maxHeight

Variable type
Integer
Description
Maximum height for the generated image. If the source image is taller than this value, it will be scaled down.
Default value
NULL
Mandatory
No

treatIdAsReference

Variable type
Boolean
Description
If this value is set to TRUE, then the ViewHelper expects the value given by src to be a sys_file_reference. If not, then it expects a sys_file or regular file path. Not required if image parameter is used.
Default value
FALSE
Mandatory
No

Examples

Using an existing image reference

Fluid:

<f:uri.image image"{file)}" />

Result:

/fileadmin/images/image.jpg