Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #956371

    Hi

    Since the latest update to Enfold 4.3.1 Youtube videos linked in the image element are not opened in a ligthbox anymore. If I click on the image, a youtube page opens in the same tab. See here: https://www.runmyaccounts.ch/videos/

    Can you please help to open the lightbox again?

    Thanks and best regards
    Thomas

    #956374

    if you haven’t changed link it makes me wonder that it has opend before in a lightbox
    add behind your youtube link add ?iframe=true f.e.: https://youtu.be/YEmI2MDpasE?iframe=true
    if you have more options like me it is with &iframe=true
    i would prefer links with many options to avoid related videos at the end ; related videos on pause etc.
    the nocookie is nice to have because of new GDPR (DSGVO on german spoken countries)

    https://www.youtube-nocookie.com/embed/<strong>ID</strong>?enablejsapi=1&ecver=2&cc_load_policy=1&playsinline=1&rel=0&showinfo=0&color=white&iv_load_policy=3&iframe=true

    #956390

    i see you got on this page a lot of videos.
    so if you are working with a child theme – and if you are not willing to do this by hand
    – do this to functions.php of your child-theme:

    function add_lightbox_option(){
    if(is_page(21397)){
    ?>
    <script>
    (function($){
    	$('a[href*="you"]').each(function(){
    	     this.href += '?iframe=true';
    	});  
    })(jQuery);
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'add_lightbox_option');

    if this does not work – than our jquery is a bit too old – and we have to find a different way.

    • This reply was modified 6 years, 7 months ago by Guenni007.
    #956754

    Hi Guenni007

    Thanks for your answer. Unfortunately adding ?iframe=true does not help. See the first video on the page https://www.runmyaccounts.ch/videos/. I thought it could have something to to with the new handling of css and js in the current release.

    Best regards
    Thomas

    #956837

    do you have a custom header.php file in your child theme?
    The first 27 lines in header.php have completely changed. So if you go with a child-theme version you have to renew your adjustments there and place a new one.

    And maybe another test : don’t know if thes you.tu links are wellcome use :

    https://www.youtube.com/watch?v=YEmI2MDpasE?enablejsapi=1&autoplay=1&ecver=2&cc_load_policy=1&playsinline=1&rel=0&showinfo=0&color=white&iv_load_policy=3&iframe=true
    

    see here with your video ( i just made the modal window bigger for my use) :
    https://webers-testseite.de/videos-on-lightbox/

    #957087

    Dear Guenni007
    Thank you very much for this suggestion. Changing the first few lines of the header.php file of the child theme has fixed the issue!
    Best regards
    Thomas

    #957181

    gut – aber denke mal darüber nach ob du nicht diesen Rattenschwanz da immer dran basteln solltest.
    Denn wenn du das Video jetzt startest, und dann pausierst, dann siehst Du was ich mit Werbung meine ( das wird mit dem ecver=2 verhindert.) und am ende die related Videos mit dem rel=0 etc. pp.
    Ausserdem ist die Nocookie Variante jetzt ohnehin besser wegen der DSGVO ( GDPR )

    #957223

    Vielen Dank für die Tipps! Werden wir ausprobieren!

    #957775

    do this to your functions.php of your child-theme and all links got that addendum:

    function add_to_youtube_videos(){
    if(is_page(21397)){
    ?>
    <script>
    (function($){
    	$('.lightbox-added[href*="www.you"]').each(function() {
    	   var $this = $(this);       
    	   var _href = $this.attr("href"); 
    	   $this.attr("href", _href + '?enablejsapi=1&ecver=2&autoplay=1&cc_load_policy=1&playsinline=1&rel=0&showinfo=0&color=white&iv_load_policy=3');
    	});  
    })(jQuery);
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'add_to_youtube_videos');
    #957821

    Thank you very much! We will try this out.

    Best regards
    Thomas

    #958787

    by the way – you have to use the script to make it easier for you .

    If you want to test these settings :
    1) the first parameter after a youtube link ( after the ID) has a questionmark ?
    2) all following parameters have to be added by a &

    so it is : https://www.youtube-nocookie.com/watch?v=YEmI2MDpasE?ecver=2&rel=0

    #958807

    Thank you, we will try this!

    Best regards, Thomas

    #986822

    Hi, I have a problem and can not use the lightbox on own template pages and in the products.

    I used the Shortcode:

    <?php 
    	echo do_shortcode("[av_image src='https://www.cmc-modell-autos.de/wp-content/uploads/2018/07/2015-supermodell-des-jahres-m107.jpg' attachment='316' attachment_size='large' align='center'  hover='' link='lightbox' target='' caption='' font_size='' appearance='' overlay_opacity='0.4' overlay_color='#000000' overlay_text_color='#ffffff' animation='animation' ][/av_image]"); 
    									 ?>

    or tried it with copying the code out of the html

    <div class="avia-image-overlay-wrap"><a href="https://www.cmc-modell-autos.de/wp-content/uploads/2018/07/2015-supermodell-des-jahres-m107.jpg" class="avia_image lightbox-added"><img class="avia_image " src="https://www.cmc-modell-autos.de/wp-content/uploads/2018/07/2015-supermodell-des-jahres-m107.jpg" alt="2015 supermodell des jahres" title="" itemprop="thumbnailUrl"><span class="image-overlay overlay-type-image" style="left: -5px; top: 0px; overflow: hidden; display: block; height: 800px; width: 610px;"><span class="image-overlay-inside"></span></span></a></div>					 
    						

    But there is no results:

    #986841

    have you a link where this does not work – or where you want that to work.

    #986842

    Hi yes it is here the Award image right below: Here i tried various possibilities

    And in my own template:

    #986847

    first of all – do you have a custom header.php in your child-theme?

    #986849

    Hi Guenni,

    no its all relatively basic – here it is working: https://www.cmc-modell-autos.de/contact/
    But when I copy the shortcode in the product template or in the masonry it is not working anymore?

    #986906

    but best would be if you open a new topic here on board. Your problem is not realy concerning to this thread here.

    #987870
Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘Open Youtube videos in lightbox’ is closed to new replies.