Skip Navigation

[Resolved] BG Video based on CPT field value

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1507493

Hello.

I am trying to build a template for a CPT created using Toolset. I am using the new Blocks. The idea is to create a field, which will contain a video (or image, there could be a switch, saying whether to use video only, or img only ...) and I'd like to be able to add this video (or image) as a header background using the value set in that CPT. So as a result I can have x pages each with a different video/image header BG.

Is that somehow possible using only Toolset?

I am using Astra Theme and UAG Blocks alongside Toolset Blocks.

Thank you.

#1508841

Hi,

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

The Toolset Blocks supports adding a dynamic background image from a custom field, through the "Container" block ( example screenshot: hidden link ), but video background support is not available.

You're welcome to submit this as a feature request at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

To achieve this without the Blocks, you'll need to add some customization, which may involve custom HTML, CSS, and Javascript code. As much as we would like to help, 1-1 customization assistance is beyond the scope of support that we can provide, but we do our best to guide in the right direction, whenever possible.

Here are some useful tutorials on adding video backgrounds:
hidden link
hidden link

And here is a guide on using the background-image property in CSS:
hidden link

Once your static sections with video and image backgrounds are ready, you can make the source of the video and image dynamic, through Toolset Types fields:
https://toolset.com/documentation/customizing-sites-using-php/functions/

The last step would be to conditionally show only one of those dynamic sections (either Video or Image background), based on the custom field values, using the conditional display feature:
https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/checking-types-fields-and-custom-fields/

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/

regards,
Waqar

#1509117

Thank you.

So the answer is that it is currently NOT possible with just Toolset.

#1509119

Not possible with the current version of Toolset.