3

I have a channel 'user' with a detail page about them.

I then use a

{reverse_related_entries channel="post"} tag to pull in entries that user created and list them on that page. This all works great.

The entry in the post channel also has a related entry, so I am trying to call it but am not having any luck. Can I call a related entry inside a reverse related entry?

Heres an example with just EE tags:

{exp:channel:entries channel="user"}
    {title} 
    {reverse_related_entries channel="posts"}
        {title}
        {related_entries id="myfield"}
            {title}
        {/related_entries}
    {/reverse_related_entries}  
{/exp:channel:entries}

but the nested related entry returns {REL[myfield]UyOu51DdREL}.

Any idea how I can get this to work?

Thanks!

2

This can be done natively using an embedded template.

{exp:channel:entries channel="user"}
    {title}
    {reverse_related_entries channel="posts"}
        {embed="_embeds/related" entry_id="{entry_id}"}    
    {/reverse_related_entries}
{/exp:channel:entries}

Then in your embed (_embeds/related):

{exp:channel:entries channel="my_channel" entry_id="{embed:entry_id}" dynamic="no"}
    {title}
    {related_entries id="myfield"}{title}{/related_entries} 
{/exp:channel:entries}
| improve this answer | |
1

Don't think you can do it natively but you can using the third party add-on Playa and the var_prefix option.

{exp:channel:entries channel="user"}
    {title}
    {exp:playa:children channel="posts" parse="inward" var_prefix="post"}
        {exp:playa:children channel="editors" var_prefix="editor"}
            {post:title} - {editor:title}
        {/exp:playa:children}
    {/exp:playa:children}
{/exp:channel:entries}

You would replace channel="editors" with the name of the related channel and set a var_prefix name that suited.

| improve this answer | |
  • Thanks for the fast reply. I was able to do it with an embed, though I'm sure playa would have been good as well. – CJbrian Jan 16 '13 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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