• how do i assign an ID to a gallery group? because i have to open a gallery with magnific popup by clicking on an image

    • This topic was modified 2 years, 6 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Do you mean this plugin?
    https://www.ads-software.com/plugins/wp-magnific-popup/
    It’s quite old, I would recommend more recent ones.

    The answer to your question depends on which PageBuilder you use. If it’s Gutenberg, you can at least assign a class under Advanced. If your gallery script also reacts to this, that should be the solution. The assignment of IDs is not possible with Gutenberg, unless there is a plugin that adds something like this, which I am not currently aware of. If you use Elementor instead of Gutenberg, for example, then there is an ID field for each element.

    Thread Starter andreaparancola

    (@andreaparancola)

    hi I apologize for the delay! in the work I have to do magnific popup, it is more comfortable to use, I try to use as few plug-ins as possible! I use gutemberg, so to open a gallery by clicking on an image I have to assign a class to the gallery !?

    I can’t answer that because I don’t know which gallery script you are using. Do you build this “magnific popup” yourself by hand? Then it is up to you how you connect the event to the images. In Gutenberg you can give each block a class under “Advanced”.

    Thread Starter andreaparancola

    (@andreaparancola)

    I integrated magnific popup, and gave the gallery block the gallery class! I do not know how to connect an image to the opening of the lightbox! skipping the preview that shows the photos in the gallery! on various blogs I have seen that they use to give an ID to make it work in this way!

    $(‘.gallery’).each(function() { // the containers for all your galleries
    $(this).magnificPopup({
    delegate: ‘a’, // the selector for gallery item
    type: ‘image’,
    gallery: {
    enabled:true
    }
    });
    });

    thanks for your patience and your availability ??

    Unfortunately, I don’t know the script at all. Normally you have to give such a script either the image object or an ID to display something specific. In the case of the Gutenberg editor, no ID can be assigned (by default without further plug-ins), which is why the script should actually take over the image object for the onclick event. Unfortunately, I cannot see this in the documentation for the script here: https://dimsemenov.com/plugins/magnific-popup/documentation.html – perhaps it would be better if you contact a community in which the script is known and used. There are at least a few contributions on stackoverflow: https://stackoverflow.com/search?q=magnific-popup

    Thread Starter andreaparancola

    (@andreaparancola)

    Thread Starter andreaparancola

    (@andreaparancola)

    thank you very much for your availability!

    Then you should ask its developers for support. However, the github directory is so old that I have little hope.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘assign ID to gallery group’ is closed to new replies.