Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Linking to images from various locations in Twig

Started by Muut Archive 10 years ago · 2 replies · 490 views
10 years ago

I have images in various locations, and I want to know how I can link them in Twig.

For instance, I can link to images in my theme's images folder like this, no prob:

--- {{ url('theme://images/shoe-landing.jpg') }} ---

But how would I link to images in my /pages/images folder?

And how could I link to images that that are defined within page markup (like this: ![Test Image 3](../test-post-3/test_image_3.jpg))? Are these accessible via Twig?

10 years ago

I know you can do url('user://data/whatever'). Not sure about .. notation.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2590 9 years ago
Archive · by Muut Archive, 9 years ago
2 1703 9 years ago
Archive · by Muut Archive, 9 years ago
2 4996 9 years ago
Archive · by Muut Archive, 9 years ago
1 3826 9 years ago
Archive · by Muut Archive, 9 years ago
3 1810 9 years ago