Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Linking to images from various locations in Twig

Started by Muut Archive 10 years ago · 2 replies · 466 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 2288 9 years ago
Archive · by Muut Archive, 9 years ago
2 1501 9 years ago
Archive · by Muut Archive, 9 years ago
2 4754 9 years ago
Archive · by Muut Archive, 9 years ago
1 3570 9 years ago
Archive · by Muut Archive, 9 years ago
3 1627 9 years ago