Support » Plugin: WF Magnific Lightbox » Disabling the lightbox for specific links

  • Hello and thank you for this very nice plugin. There is a small issue I was hoping you could help me solve.

    I require an option to selectively disable the lightbox feature on some links. For example, when linking to a file on Wikimedia, a link to a page looks like this: https://commons.wikimedia.org/wiki/File:The_Rocks_NSW_2000,_Australia_-_panoramio_(60).jpg which wf-magnific-lightox erroneously tries to lightbox, resulting in a message that the image could not be loaded.

    I’ve looked at the code of wfml-init.js and found that the download attr might serve as a workaround. However, that check is overridden by the rel attribute check before that, which makes it impossible to use rel="nofollow" in conjunction with download.

    Is there a straightforward way to accomplish this? If not, could you perhaps add one? Moving the download attr check before the rel attr check would enable my workaround, which would be good enough for my use cases.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Note: I found out that the download attribute is a bad idea, as a mobile browser I just tested tried to download the Wikimedia page as an image. I have added the following to wfml-init.js:140, as the first check for each image selector.

          //check that wmfl is not disabled on this img
          if($(this).attr('data-wfml') === 'disabled') {
            return;
          }

    I can now disable links from being lightboxed by adding data-wfml="disabled" to an anchor element. It works for me and looks like a clean solution. Would be nice if you could add this or another working solution to the plugin.

    Plugin Author wunderfarm

    (@wunderfarm)

    Hi Markus,

    thank you for writing us!
    I have committed a new version (0.9.11) that fixes that issue in the meantime as you suggested.
    If you need further assistance or have any any further questions or bugs to report please do not hesitate to contact us.

    Please don’t forget to rate our plugin with 5 shining stars if you like it. πŸ˜‰

    Thank you!

    Looks great, thanks. I do like your plugin and just awarded it five well-earned shiny stars. πŸ™‚

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disabling the lightbox for specific links’ is closed to new replies.