elementor icon indicating copy to clipboard operation
elementor copied to clipboard

Dynamic Background Video Link for Sections

Open JordanKDesigns opened this issue 8 years ago • 47 comments

Prerequisites

  • [x] I have searched for similar features requests in both open and closed tickets and cannot find a duplicate.
  • [x] The feature is still missing in the latest stable version of Elementor ( Elementor Pro. )

It would be great if we could get a dynamic option for the background video link AND fallback image for the section elements. Extending this request, I think a dynamic option for almost everything would be great.

elementor

JordanKDesigns avatar Nov 09 '18 18:11 JordanKDesigns

+1

silvioghedin avatar Nov 12 '18 10:11 silvioghedin

+1

gwashbrook avatar Dec 03 '18 02:12 gwashbrook

+1

laurentvergnaud avatar Feb 24 '19 19:02 laurentvergnaud

+1

laurentvergnaud avatar Jun 22 '19 19:06 laurentvergnaud

+1 and support local hosted/ Cloudflare stream video for performance.

wpsumo avatar Jun 30 '19 13:06 wpsumo

+1

harryneufeld avatar Sep 07 '19 15:09 harryneufeld

OMG +100

Joe-Bloggs avatar Sep 13 '19 22:09 Joe-Bloggs

Yes please!

seankbennett avatar Sep 16 '19 20:09 seankbennett

+1

artifex-media avatar Nov 15 '19 15:11 artifex-media

i have requested the same i think it will be great in that option will be added

cwebmaster avatar Dec 21 '19 17:12 cwebmaster

You can use this solution 1- Download the video you need from youtube 2- Give the video a (bg-video) Name or any name 3- uploaded it to the media folder, "I recommend creating videos folder" 4- copy the link and paste it in Elementor section video link holder its works and you can rename any downloaded video and replace the file Check this sample: https://thecarsdealer.com

Faris

cwebmaster avatar Dec 21 '19 17:12 cwebmaster

+1000 PLEASE... this is really necessary guys

kostas33 avatar Feb 02 '20 14:02 kostas33

+1!!! I just need exactly this for single post template. Does someone maybe have a workaround in the meanwhile? Thanks.

fvenuto avatar Feb 27 '20 20:02 fvenuto

An alternative I found was to enable shortcode for video link (background_video_link). In this way it is possible to work defining the video using the shortcode, making this value dynamic. Example: [acf field = "introduction_video"]. Add this code to your theme's functions.php file.

<?php
add_action( 'init', function(){
    add_action( 'elementor/frontend/section/before_render', function ( \Elementor\Element_Base $element ) {
        if ( ! $element->get_settings( 'background_video_link' ) ) {
            return;
        }
        $element->set_settings( 'background_video_link',  do_shortcode($element->get_settings( 'background_video_link' ) ) );
    } );
});

davidchc avatar Mar 02 '20 16:03 davidchc

An alternative I found was to enable shortcode for video link (background_video_link). In this way it is possible to work defining the video using the shortcode, making this value dynamic. Example: [acf field = "introduction_video"]. Add this code to your theme's functions.php file.

<?php
add_action( 'init', function(){
    add_action( 'elementor/frontend/section/before_render', function ( \Elementor\Element_Base $element ) {
        if ( ! $element->get_settings( 'background_video_link' ) ) {
            return;
        }
        $element->set_settings( 'background_video_link',  do_shortcode($element->get_settings( 'background_video_link' ) ) );
    } );
});

Hi David, this looks like a great solution for what I'm looking for, but I'm confused on where you place the shortcode after putting the code in your functions.php. Mainly I'm looking for a solution that if someone choose an image in their ACF field, it would do a image background and if they choose to do a video, it would do video, suggestions?

jakebradley2001 avatar Mar 04 '20 09:03 jakebradley2001

@jakebradley2001 , the code snippet is to be added to the functions.php file, to enable it to be possible to interpret the shortcode added in that field of the video.

About changing colors, I know it is possible to do this using the PRO version, where you define assignments, and you can choose a custom field, being able to use the ACF. And in the advanced settings of the attributes, you can define: style | background:. In this way the elementor transforms it into style = "background: Color defined Shortcode"

davidchc avatar Mar 04 '20 23:03 davidchc

+1

chloeford0 avatar Apr 04 '20 08:04 chloeford0

@davidchc Hi there, first of all, thank you for helping with this. I am trying to implement it in my site.

  1. I added your code to the functions.php
  2. i have an ACF field (type= url and slug= background_video) and
  3. i added this shortcode ini the elementor [acf field = "background_video"] .

What am i doing wrong here?? i get no video... sorry.. i am a real noob at this.. thanks in advance!

kostas33 avatar Apr 09 '20 16:04 kostas33

@kostas33, a test you can do is to add the post id in the shortcode, to know it is pulling the url correctly register in a post. Example:

[acf field = "background_video" post_id = "123"]

davidchc avatar Apr 09 '20 17:04 davidchc

@davidchc the problem is that the video is in categories, category archive page, not posts... :(

kostas33 avatar Apr 09 '20 17:04 kostas33