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

Linking to images from various locations in Twig

Started by Muut Archive 10 years ago · 2 replies · 385 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 1359 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2956 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago