YouTube video added to oEmbed field in ACF does not display in Cornerstone when being looped over

I created a custom post type titled “State Parks” that includes various field groups in ACF Pro. One of the field groups (i.e. videos) uses an oEmbed field where the user adds a link to a YouTube video. It’s in a repeater field, so someone can add multiple videos. The fields within the videos group are “video_title” and “video_link”.

Creating the Post in WordPress: When adding the YouTube url to this oEmbed field (and a text field that is being used for testing), the video displays in both places.

Cornerstone Single Post Template: After setting up the row as the looper provider ( {{dc:acf:post_field field=“videos”}} ) and the column as the looper consumer ( {{dc:acf:post_field field=“videos_video_link”}} ), it shows that I have 3 videos, but none of the videos are displaying. I have looped through the video, html - raw and text elements and none are displaying the video.

However, when I pull a single video from any of these fields in ACF (that is not in a repeater field and is not looped over in Cornerstone), the video and it’s title do display as expected. The videos and titles do not display when they are in a repeater field and being looped over in Cornerstone. FWIW, I am using the repeater ACF field on a number of other fields that do not have videos and they work perfectly.

Could you please take a look at my site?

Hello @dtsui,

Thanks for writing to us

To access the video and video title from the ACF repeater field, please use these dynamic content tags.

Video Title: {{dc:looper:field key="video_title"}}
Video embed code: {{dc:looper:field key="video_link"}}

Hope it helps
Thanks

@prakash_s,

Thank you so much for your help!!! I greatly appreciate it. That solved my problem, regardless of what ACF field I was using (oEmbed or Text). Both render correctly in Cornerstone now when looping over them.

I was not aware of the {{dc:looper:field key=“video_link”}} dynamic content tag.

One question. When using the {{dc:looper:field key=“video_link”}} dynamic content tag, why don’t you have to reference the field group container first, like you would when using {{dc:acf:post_field field=“videos_video_link”}}? videos is the group container and video_link is the name of the oEmbed field that contains the Google link inside the videos group?

Again, I can’t thank you enough for your support and insight. Have a great day!

Hello @dtsui,

You are using the Looper provider type as dynamic content with the ACF repeater field, so it returns the array. I would suggest you please have a look at this documentation to learn more about how to access the ACF repeater field using the looper.

Hope it helps
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.