WordPress.org

Ready to get started?Download WordPress

Forums

MaxGalleria: WordPress Gallery Platform
[resolved] how to disable the maxgalleria lightbox, and make my default lightbox work corre (8 posts)

  1. nanuksteeth
    Member
    Posted 2 months ago #

    Nice plugin.

    I have a questions. Is is possible to use my default gallery behaviour when it comes to viewing images in the gallery. I noticed that when I set "Thumbnail Click Opens: Lightbox Image", I get the maxalleria lightbox gallery behaviour, but I also get my normal lightbox behaviour (only it is displaying the single image clicked on) behind it. When I disable "Thumbnail Click Opens: Lightbox Image", I get my default gallery lightbox, but the gallery images are not linked, to allow navigation.

    So, ideally I need a method to

    1. Disable the maxgalleria lightbox behaviour
    as well as
    2. Ensure that the resulting gallery behaves correctly with my lightbox

    I really only want the maxgalleria plugin for organising my galleries and styling the thumbnails.

    Ps. No problem if the solution is part of the paid for add ons

    Thanks,

    Nick

    https://wordpress.org/plugins/maxgalleria/

  2. arcware
    Member
    Plugin Author

    Posted 2 months ago #

    I assume you're using the Image Tiles template... one way you could do this today is to use 3 of MaxGalleria's filters and return an empty string from each one. To do this, add the following to your functions.php file:

    add_filter('maxgalleria_image_tiles_lightbox_script', 'clear_mg_lightbox_scripts', 10, 1);
    add_filter('maxgalleria_image_tiles_easing_script', 'clear_mg_lightbox_scripts', 10, 1);
    add_filter('maxgalleria_image_tiles_main_script', 'clear_mg_lightbox_scripts', 10, 1);
    
    function clear_mg_lightbox_scripts($script) {
        return '';
    }
  3. nanuksteeth
    Member
    Posted 2 months ago #

    Thanks for replying.

    The additions for the functions.php file throw an error. I'm not sure why.

    However, I though a combination of setting "Thumbnail Click Opens: Original Image", and using "Thumbnail Custom Rel Attribute:" property might work.

    Choosing "Thumbnail Click Opens: Original Image" stops the maxgalleria lightbox from displaying, but the underlying lightbox is still not linked by my "Thumbnail Custom Rel Attribute:", which I cannot see being output at all.

    Does "Thumbnail Custom Rel Attribute:" place custom string on the thumnail rel property? Because setting this to the same for all images in a gallery would make my default lightbox work.

    Regards,

    Nick

  4. arcware
    Member
    Plugin Author

    Posted 2 months ago #

    Yes, the "Thumbnail Custom Rel Attribute" places your string into the thumbnail rel property.

  5. nanuksteeth
    Member
    Posted 2 months ago #

    Hi,

    that's great, but I have noticed that when specifying a rel attribute which will allow the default lightbox to group images into a gallery e.g prettyPhoto[gal1], the "[gal1]" part of the string is not output, resulting in a collection of images which are not grouped. This means that the lightbox navigation is not enabled, which is what I really want. Any idea how I might achieve this?

    Nick

  6. nanuksteeth
    Member
    Posted 2 months ago #

    OK, after a bit of research..I think the square brackets and their content are being removed because they're being interpreted as a shortcode.

    I even modified your plugin to append the custom rel attribute string with "[gallery ID]", it appears OK in the HTML string for output within the plugin, but never makes it to the browser.

    Regards,

    Nick

  7. nanuksteeth
    Member
    Posted 2 months ago #

    OK. My apologies for this. After a lot of head scratching, it turns out that the SmartMag theme uses some javascript to add (or overwrite!) the rel atribute for all image tags, automatically adding the pretty photo lightbox for all single images and galleries. However, it uses the default gallery css class to identify galleries otherwise it applies a prettyPhoto rel attribute without the [gallery_id] filter. I fixed the issue by adding the mg-image-tiles css class to the list to be processed by this function, and now everything works.

    Your plugin works exactly as specified. Thanks for responding anyway.

    Regards,

    Nick

  8. arcware
    Member
    Plugin Author

    Posted 2 months ago #

    Thanks for the info, and glad you got it figured out.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.