We have videos that are stored on Google drive that we want to display on a webpage for our custom post type (Events). I'd like the user to add a video's URL to the Event in a custom field, and then have the template display the URL as a video. Currently we are doing this somewhat manually by adding an iFrame field each time. But I'd like to automate this with a video block or something similar.
When I go to add the video block to my content template, I have no option for the source field. I've tried entering the field ID for the URL field, but that doesn't work. Same issue when I try to use the YouTube block. Am I missing something? Thanks!
Hi,
Thank you for contacting us and I'd be happy to assist.
If your videos hosted on Google Drive are showing correctly using the iframe HTML code, you can add a URL type custom field 'Video URL' and then store the Google Drive video links in that field.
Next, in the template, you can add a "Fields and Text" block and include the iframe HTML code for the video, in a way that the 'src' value is coming from the 'Video URL' field.
( ref: https://toolset.com/documentation/customizing-sites-using-php/functions/#url )
For example:
<iframe src="[types field='video-url' output='raw'][/types]" title="video description"></iframe>
I hope this helps and please let me know if you need further assistance.
regards,
Waqar