Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Resize via TWIG does not work

Started by Dr. Blubb 8 years ago · 0 replies · 494 views
8 years ago

Hello, I want to create a simple gallery, e.g.

<a href="{{ page.media[file.name].url }}" data-lightbox="gallery-item" title="{{page.title}}"> <img src="{{ page.media[file.name].url }}" alt=""></a>

The above srcipt is working.

But for better loading times, I want to cropResize the file in the <img> tag.

Whenever I try to use page.media[file.name].resize(200,100).url or similar, I get an exception

An exception has been thrown during the rendering of a template ("Optimus-Error: Empty reply from server, Output: ").

How to solve this exception?

Suggested topics

Topic Participants Replies Views Activity
General · by jean-louis67, 3 weeks ago
2 308 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 310 3 weeks ago
General · by Veehem, 4 weeks ago
0 263 4 weeks ago
General · by milkboy, 4 weeks ago
0 264 4 weeks ago
General · by ian russell, 1 month ago
2 335 1 month ago