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

Site-wide image in theme

Started by Muut Archive 11 years ago · 3 replies · 304 views
11 years ago

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

11 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>

11 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 Deleted User, 9 years ago
0 1326 9 years ago
Archive · by Muut Archive, 9 years ago
2 920 9 years ago
Archive · by Muut Archive, 9 years ago
2 4050 9 years ago
Archive · by Muut Archive, 9 years ago
1 2928 9 years ago
Archive · by Muut Archive, 9 years ago
3 1107 9 years ago