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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Featherlight gallery within a blog item

Started by Radoslaw 8 years ago · 0 replies · 490 views
8 years ago

I realize this has been asked already a few times, but I also having problems getting the Creating a simple gallery recipe to work in a TwentyFifteen child theme.

My intention is to add a standard Featherlight gallery as a module of a blog item.

My template files:

TXT
TwentyFifteen_Child
- templates
-- modular
--- gallery.html.twig
-- partials
--- blog.html.twig
--- blog.item.html.twig

Gallery.html.twig:

HTML
<ul>
    {% for image in page.media.images %}
    <li>
        <div class="image-surround">
            {{ image.cropResize(300,200).html }}
        </div>
        <div class="image-info">
            <h2>{{ image.meta.title }}</h2>
            <p>{{ image.meta.description }}</p>
        </div>
    </li>
    {% endfor %}
    </ul>

Content files:

TXT
- 02.blog
-- blog item
--- _gallery
---- a.jpg
---- a.jpg.yaml

I think I may be missing something about adding a module to a standard blog item page (thus making it modular), but not sure what?

Does my "_gallery" folder also require a "gallery.md" file? If yes, what should it contain?

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 47 1 week ago
Plugins · by Xavier, 4 weeks ago
2 56 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1182 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 74 2 months ago