WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery Optimizer
Incompatible with [private] tags (4 posts)

  1. mygov
    Member
    Posted 1 year ago #

    Hi,
    I'm using Magic Members Plugin and NEXTGen. This is working nice. But if I activate NEXTGen Gallery Optimizer, the Gallery shows only in a vertical line & the images will be load in a new window.

    The Magic Members Plugin have a [private]-Tag where I can define payable content.
    If I use
    [private]
    [nggallery id=1]
    [/private]

    The gallery is not working anymore, I use the [nggallery id=1] tag without private it is working fine.

    It seems every time in the page is a [private]-tag the NEXTGen optimizer code will NOT be loaded anymore.

    In the HTML-Source the following lines are still REMOVED with private tag:

    <link rel='stylesheet' id='nggo_fancybox.css-css'  href='http://****.com/wp-content/plugins/nextgen-gallery-optimizer/css/jquery.fancybox-1.3.4.css?ver=1.3.4' type='text/css' media='screen' />
    <link rel='stylesheet' id='nextgen.css-css'  href='http://****.com/wp-content/plugins/nextgen-gallery/css/ngg_dkret3.css' type='text/css' media='screen' />
    <script type='text/javascript' src='http://****.com/wp-content/plugins/nextgen-gallery-optimizer/fancybox/jquery.fancybox-1.3.4.pack.js?ver=1.3.4'></script>
    <!-- [nextgen gallery optimizer v1.1] This page must contain a nextgen shortcode...else we wouldn't be serving its scripts and styles -->
    <script type='text/javascript'>jQuery.noConflict(); jQuery(document).ready(function() { jQuery('a.myfancybox').fancybox({ 'zoomSpeedIn':500, 'zoomSpeedOut':500, 'overlayShow':true, 'overlayOpacity':0.3 }); });</script>

    Did you have any ideas how I can solve this issue?

    Thanks a lot!

    http://wordpress.org/extend/plugins/nextgen-gallery-optimizer/

  2. Mark Jeldi
    Member
    Plugin Author

    Posted 1 year ago #

    Hi mygov,

    Thanks for downloading NextGEN Gallery Optimizer!

    It sounds like Optimizer isn't detecting the [nggallery id=x] shortcode (and therefore not loading the necessary scripts), when nested inside the Magic Members [private][/private] shortcodes. Well, at least when MM is active.

    Unfortunately, I don't have access to this very premium plugin to test and troubleshoot, however the nested shortcode structure you're using does work perfectly when Magic Members isn't present...so there may be some kind of conflict.

    Experimenting with this further, I've just tried nesting [nggallery id=x] between shortcodes used in a plugin called "Show/Hide Content at Set Time"...and this caused NextGEN Gallery to not load at all (just prints the shortcode), regardless of whether Optimizer was activated or not.

    I'll continue to look into this nesting of shortcodes as it's clearly leading to unpredictable behavior, but in the meantime, I would suggest contacting Magic Members support, as they'd have a better idea of what's going on inside their plugin.

    I hope this helps,
    Mark.

  3. mygov
    Member
    Posted 1 year ago #

    Hi Mark,

    I'm now using aMember and its now the same problem with the [am4show]-tag.

    But I have found a workaround, I added a [nggallery] with <span style="display: none;">[nggallery]</span> at the beginning of the post. (Before the protection-tag beginning) This is not the best way, but the only one that works. :|

    I hope you can find a solution for this bug.

    Thanks!

  4. Mark Jeldi
    Member
    Plugin Author

    Posted 1 year ago #

    Hi mygov,

    Thanks for the update...that's a clever workaround!

    I've been looking into this a lot, and I've found it's only possible to use nested shortcodes if the outer shortcode uses return do_shortcode($content); to output its content...

    http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes

    I've tested this myself and it explains why you're able to return a gallery (albeit unformatted), while the plugin I tested returned nothing (until I made this addition). The shortcode functions in Magic Members and aMember likely have the do_shortcode added in.

    The problem with the formatting and loading of Fancybox in this situation, is that the do_shortcode function runs too late for us to insert the required scripts and styles in the head section (where they need to be to function correctly). This is the same issue Optimizer has with using do_shortcode in theme files, or loading scripts for widgets (as detailed in the FAQ).

    If you know which posts you're going to want to use the gallery's scripts and styles on (say, all posts in a particular category), we could use a conditional statement in Optimizer that ensures they load wherever you need them. If that sounds like something you'd like to try, just let me know and I'll code it up for you.

    Cheers,
    Mark.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.