Okay
  Public Ticket #2390745
opening videos in lightbox
Closed

Comments

  •  1
    Chris started the conversation

    Hi there,

    I want to use the creative portfolio page to navigate through a collection of embedded Vimeo videos. I need to link individual portfolio items in the Creative portfolio to open an embedded Vimeo video directly inside a lightbox, rather than link to a portfolio single page. Could you please point me in the right direction. Thanx

  •  1,973
    Support replied

    Hello Chris

    You can but you need to modify a file /sections/portfolio_section_item.php

    you need to modify the <a> tag that opens the item o the individual portfolio page, so this line:

    <a class="item-wrap ajax-link-project" data-type="page-transition" href="<?php echo esc_url( $item_url ); ?>"><?php if( hervin_get_theme_options('clapat_hervin_enable_ajax') ){ ?></a><?php } ?>

    so that when it's about a video item it will open a vimeo lightbox

    Hope it clarifies

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  1
    Chris replied

    Thank you for the reply,

    Unfortunately your answer doesn't get me much further. In following this approach I have the issue of passing the Video ID parameter to the Vimeo URL. As this is not stored anywhere in specific on the portfolio page other than as content in an embedded video link. I also was not able to create custom variables inside the portfolio page so I have no way of passing over the video-id parameter. Is this something you could implement for me? What would be the approximate cost for such customization work?

  •  1,973
    Support replied

    You could post the video ID parameter in the video webm or mp4 urls fields and then if the portfolio item is a video portfolio item you read the field and use it for the vimeo lightbox link

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  1
    Chris replied

    Hi there, thanks for your tips.

    1) added a function VimeoLightbox() to the scripts.js to open a majestic-popup with an embedded vimeo video link

    function VimeoLightbox() { $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ disableOn: 700, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false });

    2) added the vimeo link http://Vimeo.com/140160263 to portfolio item

    3) modified portfolio_section_item.php

    <a class="item-wrap popup-vimeo ajax-link-project" data-type="page-transition" href="<?php echo esc_url( $hervin_video_mp4_url ); ?>"><!--?php if( hervin_get_theme_options('clapat_hervin_enable_ajax') ){ ?--></a><!--?php } ?--> </a>

    The popup is being invoked but the Vimeo URL is not being passed along, I suspect that simply replacing $item_url with  $hervin_video_mp4_url  inside php echo esc_url() is not the proper way of passing along the player parameters.

    I am getting the console error: HTTP “Content-Type” of “text/html” is not supported. Load of media resource https://vimeo.com/140160263 failed.

    can you help, please.

    Cheers,
    Chris





  •  1,973
    Support replied

    Hi Chris,

    two things:

    1. try removing ajax-link-project class from the portfolio item

    2. can you send us the url of the page so we can inspect it? (the url of the page containing the light box popup you've implemented)


    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  1
    Chris replied

    Hi there,

    thanx for the quick reply. I removed the ajax-link-project class but still the same, popup loads empty.

    The URL : https://dev-ff-fresh.pantheonsite.io/creative-portfolio/

    Thanx,

    Chris

  •  1,973
    Support replied

    Hi Chris 

    it looks like you don't have anything in the href attribute

    https://prnt.sc/ser382

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  1
    Chris replied

    Hi there,

    I don't get it. This is the code I am using inside the portfolio_section_item.php file:

    <div class="item-content">
    <a class="item-wrap popup-vimeo" data-type="page-transition" href="<?php echo esc_url( $hervin_video_mp4_url ); ?>"><?php if( hervin_get_theme_options('clapat_hervin_enable_ajax') ){ ?></a><?php } ?>

    maybe because $hervin_video_mp4_url  is declared further down at line 34 that href is empty? How do I restructure the statement to make it work?

    $hervin_video_mp4_url = hervin_get_post_meta( HERVIN_THEME_OPTIONS, get_the_ID(), 'hervin-opt-portfolio-video-mp4' );

    see attached php file (.txt)


  •  1,973
    Support replied

    I'm not sure what's happening there can you provide wp admin access in a private comment?

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •   Chris replied privately
  •   Support replied privately
  •   Chris replied privately
  •   Support replied privately
  •   Chris replied privately
  •   Support replied privately