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

Featherlight with meta.yaml

Started by Muut Archive 10 years ago · 3 replies · 527 views
10 years ago

I'm struggling to have a lightbox with image, text and links. I'm experimenting featherlight using meta.yaml files, although I'm not sure I can accomplish that.
It works good with text, in fact I can show all textex from meta.yaml, but I'm at loss in how to show a picture. Maybe Is not possible but really I do not know. Maybe I need to find a way to use ajax, but it is totally new for me.
This is my actual code

TWIG
{% for image in page.media.images|reverse %}
   <a href="#" data-featherlight="<h2>{{ image.meta.title }}</h2>
   <a>{{ image.meta.desc }}</a>
   <a>{{ image.meta.credits.cast }}</a>
   <a>{{ image.meta.trailer }}</a>">{{ image.cropResize(305).html }}</a>
{% endfor %}

I'm looking for any suggestion, thanks

10 years ago

It would be helpful to show hyperlinks in this way, but I can't.

10 years ago

Thanks Rhukster, actually yesterday I've updated Grav and finally I was able to create hyperlink inside html attribute via Twig variable, it also supports if statement, great.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1367 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago