1

This is the first time that I'm using the new Realationships field and I can't seem to get it to work with Channel Videos.

I am trying to display all videos from my relationship field "{related_entries}" from the channel "videos".

Here is my template code:

<div>
<ul>

{exp:channel:entries channel="video_courses" disable="categories|category-fields|member-data|pagination"}
{related_videos}
{exp:channel_videos:videos prefix="cv"}


<li><a href="{title_permalink='videos/view'}" class="image"><img src="{cv:img_url_hd}" alt="image01" /><h2><span>{title}</span></h2></a></li>

{/exp:channel_videos:videos}

{/related_videos}
{/exp:channel:entries}

  </ul>
</div>

However it is not outputting anything. Any thoughts appreciated...

1 Answer 1

2

The related_videos tag pair will loop through any you have selected, and for each loop you need to tell channel_videos which video you're looking for. So you could use the entry id parameter, something like:

{related_videos}
    {exp:channel_videos:videos prefix="cv" entry_id="{related_videos:entry_id}"}
        <li><a href="{title_permalink='videos/view'}" class="image"><img src="{cv:img_url_hd}" alt="image01" /><h2><span>{related_videos:title}</span></h2></a></li>
    {/exp:channel_videos:videos}
{/related_videos}

using the related_videos for a prefix to point to children variables in your video channel. You also might have to change the formatting for the permalink.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.