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

How to use image from theme folder in page theme

Started by Muut Archive 10 years ago · 1 replies · 503 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 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