This Pro tutorial provides the steps to set the source of a Bricks video element on single CPT pages to be the URL of a video that has been linked to the current CPT item using Meta Box‘s Post custom field.
Scenario:
CPT 1: service with a video custom field of type “Post” with the Post type set to video (Multiple is not checked).
CPT 2: video with a video_embed custom field of type “oEmbed”.
Sample Video CPT item:

Sample Service CPT item

On the front end:

Step 1
Let’s define a custom function that gets the URL of the oEmbed video of the video post whose ID is the value of the current post’s video field.
Add the following in child theme‘s functions.php or a code snippets plugin:
if ( ! function_exists( 'bl_get_related_video_url' ) ) {
function bl_get_related_video_url(): string {
return rwmb_get_value( 'video_embed', '', rwmb_meta( 'video' ) );
}
}
Step 2
Edit the single service template with Bricks.
[optional] Add a Heading inside a Section’s Container. Change its text to something like “Related Video”.
Add a Video element inside the Container.
Source: Dynamic Data
{echo:bl_get_related_video_url}


Step 3
Add a Dynamic data condition on the Section to ensure that it gets output only if the Video field is populated.
