Skip to main content

Usage Markdown/Template

Markdown

Basic

Basic image
![alt text](image.jpg "title text")

Preset

Basic image
![alt text](image.jpg?preset=spacerImage "title text")

No Image server

info

Special preset to not process the image. p wrapper will still be removed`

Basic image
![alt text](image.svg?preset=noImageServer "title text")

Template examples

Parameters in twig

No specific oder or attributes are needed, except imageName.

Basic (minimal)

{% include 'picture.html.twig' with {
'image': object.header.img
} %}

Basic (alt,title)

{% include 'picture.html.twig' with {
'image': object.header.img,
'alt': object.header.alt,
'title': object.header.title
} %}

Preset

{% include 'picture.html.twig' with {
'image': object.header.img,
'alt': object.header.title,
'preset': 'myPreset'
} %}

Parameters

{% include 'picture.html.twig' with {
'image': object.header.img,
'alt': object.header.title,
'ratio': 0.33,
'class': 'img-fluid w-50 border-radius',
'loading': 'eager'
...
} %}

Overwrite preset

{% include 'picture.html.twig' with {
'image': object.header.img,
'alt': object.header.title,
'preset': 'myPreset',
'ratio': 0.33,
'class': 'img-fluid w-50 border-radius',
'loading': 'eager'
...
} %}

Twig

danger

This shouldn't be used. Template (section above) will be not be effected after API changes. Also, if you want to remove the image server plugon, you cna set up your own picture template and manage everything yourself without replacing the functions. Take a look inside template for all parameters.

Twig picture function
{{ picture(imageName) }}