Giter Club home page Giter Club logo

Comments (3)

zeigerpuppy avatar zeigerpuppy commented on May 28, 2024 1

I am also trying to create a gallery template but I think I'm not quite there. I have created a folder with images and metadata

01.Images
       |- gallery.md
       |- image1.jpg
       |- image1.jpg.meta.yaml
       |- image2.jpg
       |- image2.jpg.meta.yaml

gallery.md has the following template gallery.html.twig:

{% extends 'partials/base.html.twig' %}

{% block content %}
    {{ page.content }}

     {% for image in page.media.images %}
         {{ image.lightbox(1024,768).cropResize(200,200).html(image.meta.title) }}
     {% endfor %}

{% endblock %}

This sort of works, each image is shown sequentially and activates the lightbox
However, I'd like to be able to then proceed to the next image in a gallery.
How would one do this?

Ideally, I'd like to have the featherlight gallery working on and image collage like https://github.com/petrgrishin/grav-plugin-image-collage

from grav-plugin-featherlight.

kitzberger avatar kitzberger commented on May 28, 2024

You would have to manipulate the script that initializes the featherlight gallery. That's a quite easy task as soon as pull request #11 is approved ;-)

Then you just would have to make sure to identify the links that belong together and work with a init script like this:

$('#elementWrapper_1 a[rel=lightbox]').{pluginName}({
        openSpeed: {openSpeed},
        closeSpeed: {closeSpeed},
        closeOnClick: '{closeOnClick}',
        root: '{root}',
});

Setting a different rel attribute than 'lightbox' when creating a lightbox link would make it even easier, I think. But that's currently not possible with the grav core since the rel attribute is hard coded at the moment.

from grav-plugin-featherlight.

Tamriel avatar Tamriel commented on May 28, 2024

However, I'd like to be able to then proceed to the next image in a gallery.

Your code works for me well. The next image button appears when you hover the mouse over the edge of the image.

from grav-plugin-featherlight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.