Support » Plugin: YouTube Channel » How to open video in new window

  • Resolved bakercreative

    (@bakercreative)


    Hi, this is my shortcode below. I want the thumbnail links to open up in a new browser window, rather than the existing window. How do I achieve this? I tried adding popup=_blank to the shortcode but that didn’t work.

    [youtube_channel channel=XXXXXXXXXXXX resource=0 cache=0 privacy=1 fetch=10 num=4 ratio=3 responsive=1 class=ytc_wall_1-6 width=306 display=thumbnail norel=1 nobrand=1 showtitle=below desclen=0 noanno=1 noinfo=1 popup=_blank]

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @bakercreative,

    At the moment, you can only prevent opening video in lightbox by enabling option “Disable Lightbox” in plugin settings on tab “Video”. If you don’t have any other lightbox plugin on website, instead of lightbox video will be opened in same window.

    Then you can add small jQuery code to page where you have YouTube Channel block, to set anchor target to blank, something like:

    
    jQuery(document).ready(function($) {
    	jQuery('.youtube_channel .ytc_video_container a.ytc_thumb').attr('target','_blank');
    });
    

    This will make YTC thumbnails to open video on YouTube in new window/tab.

    Btw, as this looks like interesting feature request, I added it to TODO list for some future release.

    Kind regards,
    Aleksandar

    Hello @bakercreative,

    New version of plugin 3.0.11 introduce new shortcode parameters:

    • nolightbox (bool) Set this option to 1 or true to prevent YTC block with thumbnail to open in lightbox. If you have other plugin that trigger youtube links for lightbox, that one will steal links from this YTC block.
    • target (string) If you enable nolightbox for specific YTC block, you can force opening of thumbnail links in new tab/window if you set this shortcode option to _blank like target="_blank".

    Now you can use following shortcode to open thumbnail video link in new tab/window instead in lightbox (popup):

    [youtube_channel channel=XXXXXXXXXXXX resource=0 cache=0 privacy=1 fetch=10 num=4 ratio=3 responsive=1 class=ytc_wall_1-6 width=306 display=thumbnail norel=1 nobrand=1 showtitle=below desclen=0 noanno=1 noinfo=1 nolightbox=1 target=_blank]

    Kind regards,
    Aleksandar

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.