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

How to use image from theme folder in page theme

Started by Muut Archive 10 years ago · 1 replies · 423 views
10 years ago

I would like to use image, that user can upload to the theme folder and show it on any page. I would like to use media functions like: negate, lightbox, cropZoom on this image.
I do know how to display images as it is, by using this code:

TWIG
<img src="{{ url("theme://images/pages/" ~ category.image) }}" alt="{{ category.category_name|e }}" />

But I can not use any of above functions.

More over I was trying to use a markdown but even if I did set config and put markdown="1" in my template I wasn't able to use markdow - it was showing like literal without compilation, even when I was using code from:
https://learn.getgrav.org/cookbook/general-recipes#wrapping-markdown-into-html

10 years ago

Probably it is impossible becouse according to GRAV documentation: https://learn.getgrav.org/content/image-linking

If you decide to use a centralized image directory, be advised that this directory should exist within the /pages folder as this folder is intended for front-facing content.

I should read it ealier.

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