Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Resize via TWIG does not work

Started by Dr. Blubb 8 years ago · 0 replies · 621 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 Hanns Mattes, 4 days ago
0 85 4 days ago
General · by Karmalakas, 6 days ago
2 147 5 days ago
General · by Hanns Mattes, 3 weeks ago
0 210 3 weeks ago
General · by Dima, 3 weeks ago
1 193 3 weeks ago
General · by pamtbaau, 4 weeks ago
0 306 4 weeks ago