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.
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
Thank you.
So the answer is that it is currently NOT possible with just Toolset.
Not possible with the current version of Toolset.