Skip to main content

Description

The Image tag displays images from a given field in a result or a src. It will automatically resize and cache the image for performance. The following module will need to be added to your pom.xml in order to use the twigkit image-service.
If your image is within an expression you will need to use the trusted filter eg (<media:image src="{{imageUrl | trusted}}"></media:image>) If you are combining plain text with a variable it is recommend that you do this within a function in a controller. You can see this in the example below. This will remove the chance of getting a 404 in the JavaScript console caused by a request for the image being sent before the values in the src attribute were evaluated.

Example

Controller

View

Usage

as element:

Parameters