Support » Plugin: WordPress Gallery Plugin - FooGallery » Foogallery and JackBox

  • Hi,

    I’m using a stripped down version of JackBox lightbox (within the theme I purchased) which works relatively well for displaying a single file as long as an image’s link is the actual image, which is fine.

    The issue is that when I click on the image, it pops up standalone, without creating a “browsable” gallery, like with native WP galleries.

    <a href="http://mydomain.com/wp/wp-content/uploads/2015/10/myimage.jpg" data-caption-title="This is the title." data-attachment-id="2005" data-group="image_1" data-title="Image Title" class="jackbox jg-entry entry-visible" data-jackbox-state="init" style="width: 637px; height: 424.667px; top: 2px; left: 2px;">
    <img src="http://mydomain.com/wp/wp-content/uploads/cache/2015/10/myimage/3574832458.jpg" alt="alt text" height="700" style="width: 637px; height: 425px; margin-left: -318.5px; margin-top: -212.5px;"><div class="caption">Image Title</div></a>

    The string that controls the gallery structure is data-group="image_1". As long as the string is the same (I would guess while loading the images) it should behave as a gallery.

    The thumbnails are encapsulated within a div with these classes:

    <div data-justified-options="{ "rowHeight": 400, "maxRowHeight": "160%", "margins": 2, "captions": true }" id="foogallery-gallery-2054" class="foogallery-container foogallery-justified foogallery-lightbox-jackbox justified-gallery" style="height: 8595px;"></div>

    My understanding of JS and jQuery is very, very basic – to say the least – but I tried to use this as a Foogallery custom Lightbox extension to force the string to be the same:

    function add_html_attributes($attr) {
    	global $current_foogallery;
    
    	$lightbox = foogallery_gallery_template_setting( 'lightbox' );
    
    	//if the gallery is using our lightbox, then alter the HTML so the lightbox script can find it
    	if ( 'jackbox' == $lightbox ) {
    		//add custom attributes to the anchor
    		$attr['rel'] = "jackbox[foogallery-{$current_foogallery->ID}]"; // just to see if it registers
    		$attr['data-group'] = "gallery_99";
    
    }

    The rel string did appear loaded within the a tag but the data-group was changed by the lightbox.

    Do you have any suggestions on how to do this?

    Thanks for foogallery, great plugin.

    https://wordpress.org/plugins/foogallery/

Viewing 1 replies (of 1 total)
  • Plugin Author bradvin

    (@bradvin)

    Hi

    Looking at your add_html_attributes function, did you return the $attr variable? It does not seem that way from your code snippet

Viewing 1 replies (of 1 total)
  • The topic ‘Foogallery and JackBox’ is closed to new replies.