Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1115693

    i have on one page in different containers image links with lightbox linking – others have a manual link to a Youtube video with iframe=true.
    How can I prevent that in the “Lightbox” these two different approaches unite in a gallery?

    The reason for this is clear – I want to prevent someone who comes into the lightbox via an image from being able to call the youtube video via the next button without having agreed to the GDPR conditions.

    Edit: i know if these different links are in different color-sections – there was no gallery mix. But that is not allways possible.

    #1116241

    Hey Guenter,

    You can add a different class to the galley and init lightbox for this class separately.

    Maybe something like this
    https://kriesi.at/support/topic/how-to-invoke-lightbox-from-image-but-show-different-content-in-lightbox/#post-361096

    Best regards,
    Victoria

    #1116343

    But how to influence ( hook to ) the enfold lightboxes – not the inline popups.

    by the way – you see the link in private content. This is no gallery from the start. There are on that page different media files which have all a lightbox link.
    The default enfold way on the alb to have lightbox.
    I want to avoid that all media files are part of the “gallery” in the lightbox by clicking the next (or prev.) Button. On default Enfold behavior it is different Media files in different color-section are not part of one lightbox gallery.

    So is there a way to split in a layout without color-sections f.e. videos in one lightbox – images in the other?

    #1116392

    Hi Guenni007,

    I meant something like this.
    https://kriesi.at/support/topic/triggering-lightbox-gallery-with-link/

    Well, you’ll need to add separate groups to every image element.

    Best regards,
    Victoria

    #1116515

    thanks for the hint :
    my solution now is ( because the youtube links : images with link to youtube films with iframe=true) have on lightbox-added the additional class: mfp-iframe i can do it this way:
    1) i gave the data-group to lightbox-added – then to mfp-iframe – so they got different data-groups
    2) and i had to add the main-class to magnific popup uses on enfold case to work properly
    3) i have to do it with window load not document ready

    // custom lightbox
    function add_custom_script_lightbox(){
    ?>
    <script>
    (function($){
    	$(window).load(function() {
                    $('.lightbox-added').attr('data-group', '1');
    		$('.mfp-iframe').attr('data-group', '2');
    		var groups = {};
    		$('.lightbox-added').each(function() {
    		  var id = parseInt($(this).attr('data-group'), 10);
    
    		  if(!groups[id]) {
    		    groups[id] = [];
    		  }
    
    		  groups[id].push( this );
    		});
    
    		$.each(groups, function() {
    
    		  $(this).magnificPopup({
    		      type: 'image',
    		      mainClass: 'avia-popup mfp-zoom-in mfp-image-loaded',
    		      closeOnContentClick: false,
    		      closeBtnInside: false,
    		      gallery: { enabled:true }
    		  })
    
    		});
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script_lightbox');
    
    #1117101

    Hi Guenni007,

    Thank you for sharing!

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1118177

    no you can close it now

    #1118204

    Hi Guenni007,

    Hope the solution will serve future generations :)

    Best regards,
    Victoria

    • This reply was modified 8 months, 3 weeks ago by  Victoria.
Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘lightbox galleries’ is closed to new replies.