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 →

Site-wide image in theme

Started by Muut Archive 12 years ago · 3 replies · 502 views
12 years ago

How can I access, in a partial view, images that are placed in the 'assets' or 'images' folder of a theme?

12 years ago

Thats the whole point of the question: I dont eant a theme specific logo in pages/images, but in a folder in the theme. I was hoping I could reference the image in a better way that <img src=themes/mytheme/images/logo.ext>

12 years ago

You can use an image from a directory such as /user/themes/antimatter/images/logo.png like this:

TWIG
<img src="{{ url('theme://images/logo.png') }}" />

This will automatically resolve the URL to the current theme then add the images/logo.png to the that.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Muut Archive, 10 years ago
1 672 1 week ago
Archive · by Deleted User, 9 years ago
0 3043 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5336 9 years ago
Archive · by Muut Archive, 9 years ago
1 4134 9 years ago