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

Learn2 theme breaks featherlight gallery

Started by Michal Lower 8 years ago · 3 replies · 937 views
8 years ago

Hi,

I'm trying to setup a website based on Learn2 theme. I have problem getting grav-plugin-featherlight gallery function to work. After some debugging I've tracked the problem down to theme specific code.

Test project has featherlight gallery on the end of 01.home page. If you set quark as a theme it works, after switching to learn2 lightbox shows but you cannot navigate to previous/next image.

There's some featherlight specific code in learn2 .js and .css files but I don't know grav enough to sort it out.

8 years ago

Do you have a working version online maybe?

8 years ago

no, but see repro I've attached to my first post

3 years ago

This is still an issue.
Remove this from learn.js

JS
$(function() {
    $('a[rel="lightbox"]').featherlight({
        root: 'section#body'
    });
});

And kill

TWIG
{% do assets.addJs('theme://js/featherlight.min.js') %}
{% do assets.addCss('theme://css/featherlight.min.css') %}

from base.html.twig. Otherwise it's loaded 2 times and the plugin gets buggy.

After this, i successfully set up a featherlight gallery. It works out of the box for all images on a page i think.

last edited 05/24/23 by Jan

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Slebeig, 3 weeks ago
4 221 3 weeks ago
Themes & Styling · by Pedro M, 3 months ago
4 492 2 months ago
Themes & Styling · by Ian, 3 months ago
3 263 3 months ago
Themes & Styling · by Norbert, 2 years ago
11 649 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 202 3 months ago