Images
A small basic image resizing tool is built into the site's system.
The resize is done to the largest width and the resized image is cached.
The cached image is automatically updated if the original image changes.
Raw image
- Twig code:
<img src="{{ asset('../assets/twig.png') }}">
- Rendering:
Resized image
Max(width, height)
- Twig code:
<img src="{{ thumbnail('../assets/twig.png', 200) }}">
- Rendering:
Force width
- Twig code:
<img src="{{ thumbnail('../assets/twig.png', 'w80') }}">
- Rendering:
Force height
- Twig code:
<img src="{{ thumbnail('../assets/twig.png', 'h80') }}">
- Rendering:
Note
Coming from the pages
folder and not public
, only access via resize is possible:
- Twig code:
<img src="{{ thumbnail('../php.png', 100) }}">
- Rendering:
Url format
Original image | Resized image |
---|---|
{path}{basename}.{extension} |
{path}{basename}.{size}.{extension} |
some/path/image.jpg |
some/path/image.512.jpg |
some/path/image.jpg |
some/path/image.w512.jpg |
some/path/image.jpg |
some/path/image.h512.jpg |
- Supported extensions:
jpg
,png
,gif
- Supported dimensions: minimum
16
, maximum2000