Skip Navigation

[Resolved] Video Slider?

This thread is resolved. Here is a description of the problem and solution.

Problem:

The customer wanted to create a slider for videos similar to an existing image slider on their site. Although the videos were set up as custom fields, they were currently displayed in a row on the page instead of a slider format.

Solution:

We advised the customer that Toolset does not have a built-in feature to directly display multiple videos from a custom field in a slider. Instead, we provided a custom HTML structure using the [wpv-for-each] shortcode to wrap the video outputs, along with custom CSS to style the videos in a slider-like format. This allowed the videos to be visually organized, improving their appearance.

You can start by wrapping your video outputs in a custom HTML structure like this:

<div class="video-slider-wrapper">
    [wpv-for-each field="wpcf-youtube-videos"]
        <div class="video-slide-item">
            <div class="video-frame">
                [types field="youtube-videos"][/types]
            </div>
        </div>
    [/wpv-for-each]
</div>

Then, add the following custom CSS to your content template to style these videos in a slider format:

.video-slider-wrapper {
    display: block;
    overflow: hidden;
}
 
.video-slider-wrapper .video-slide-item {
    float: none;
    width: 98%;
    overflow: hidden;
    margin: 1% 1% 4% 1%;
    background: #fff;
    padding: 1%;
    box-shadow: 0px 0px 10px 0px rgb(0 0 0 / 50%);
}
 
.video-slider-wrapper .video-slide-item .video-frame {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 30px;
    height: 0;
    overflow: hidden;
}
 
.video-slider-wrapper .video-slide-item .video-frame iframe,
.video-slider-wrapper .video-slide-item .video-frame object,
.video-slider-wrapper .video-slide-item .video-frame embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
 
@media screen and (min-width: 801px) {
    .video-slider-wrapper .video-slide-item {
        float: left;
        width: 30%;
        overflow: hidden;
        margin: 1% 2% 2% 1%;
    }
}

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 5 replies, has 2 voices.

Last updated by Mateus Getulio 2 months, 2 weeks ago.

Assisted by: Mateus Getulio.

Author
Posts
#2742891

Tell us what you are trying to do?
Create a slider for my videos like I have for the images. The videos are setup us custom fields already and are currently just listing in a row on the pages. I would like for them to be a slider like the photos.

What is the link to your site?
hidden link

#2743530

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Korie,

Thank you for contacting us and I'd be happy to assist.

I checked it and it looks like those videos are coming from Youtube.

The Toolset Views plugin offers a built-in slider functionality which can be used to slide images and HTML content, as explained in this guide:
https://toolset.com/documentation/user-guides/views/creating-sliders-with-types-and-views/

To make these slides also include looped video background from an external source like Youtube, you'll need some customization through HTML, CSS, and scripts.

Here are some guides on how to include Youtube videos as a background and you can use these suggestions into your slider created through the Toolset Views.

hidden link
hidden link
hidden link

Alternatively, you can consider using a 3rd party plugin or a page builder for the video slider and use the data from Toolset to 'feed' the plugin. Eg.: https://wordpress.org/plugins/video-gallery-playlist/

I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

Best regards,
Mateus

#2743789

Thanks - I can get any of these to work properly. Is there a way to make a toolset field be a shortcode? Then I could use custom video sliders for each material. I'm just not sure which type of field could handle being a shortcode, if any?

#2744403

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there.

Yes, you should be able to display it by using this shortcode below:

[types field='my-field'][/types]

Where 'my-field' is the slug of your custom video field.

Thanks, please check if this is what you need to make it work.

#2745011
Screen Shot 2024-09-12 at 9.19.07 AM.png

Okay, so I would setup a custom field as which field type to do this?

And then I would enter the shortcode you provided into my content template?

#2745597

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Based on the URL you provided it looks like you already have the custom field, I believe you'd not have to create it, you can use the one you already set up.

Currently, Toolset doesn't have a built-in feature to display multiple videos from a custom field in a slider or gallery view, so some custom coding will be necessary.

You can start by wrapping your video outputs in a custom HTML structure like this:

<div class="video-slider-wrapper">
    [wpv-for-each field="wpcf-youtube-videos"]
        <div class="video-slide-item">
            <div class="video-frame">
                [types field="youtube-videos"][/types]
            </div>
        </div>
    [/wpv-for-each]
</div>

Then, add the following custom CSS to your content template to style these videos in a slider format:

.video-slider-wrapper {
    display: block;
    overflow: hidden;
}

.video-slider-wrapper .video-slide-item {
    float: none;
    width: 98%;
    overflow: hidden;
    margin: 1% 1% 4% 1%;
    background: #fff;
    padding: 1%;
    box-shadow: 0px 0px 10px 0px rgb(0 0 0 / 50%);
}

.video-slider-wrapper .video-slide-item .video-frame {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 30px;
    height: 0;
    overflow: hidden;
}

.video-slider-wrapper .video-slide-item .video-frame iframe,
.video-slider-wrapper .video-slide-item .video-frame object,
.video-slider-wrapper .video-slide-item .video-frame embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media screen and (min-width: 801px) {
    .video-slider-wrapper .video-slide-item {
        float: left;
        width: 30%;
        overflow: hidden;
        margin: 1% 2% 2% 1%;
    }
}

This custom code is intended as a starting point. You may need to adjust it to suit your specific requirements.

If you require more personalized assistance with custom coding, you might also consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/

I hope this helps! Please let me know if you have further questions or need more help.

#2745682

Thank you! This didnt turn it into a slider, but it as least wrapped them so they look much nicer!

hidden link