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.

Themes & Styling

Learn2 theme breaks featherlight gallery

Started by Michal Lower 8 years ago · 3 replies · 872 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?

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 Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago