0

I used "{reverse_related_entries}" before but after the upgrade (2.8.1) i like to use the new Relationships.

I found some stuff in the docs. But i can't figure out what i have to do when the relationship-field is into the ChildChannel:

ParentChannel

  • title

ChildChannel

  • title
  • relationship_field (Relationship)

Template for ChildChannel:

{exp:channel:entries channel="ParentChannel"}
{title}
{relationship_field}{relationship_field:title}{/relationship_field}     
{/exp:channel:entries}

What i need is a menu like this:

  • Product-Family (from ParentChannel)
    • Product 1 (from ChildChannel with Relationship to Product-Family)
    • Produkt 2 (from ChildChannel with Relationship to Product-Family)
    • Produkt 3 (from ChildChannel with Relationship to Product-Family)
1

You need to use the parents tag pair (docs), since your "child" products are actually the "parents" (because the relationship originated from their entries, not the other way around).

{exp:channel:entries channel="ParentChannel"}
    {title}
    {parents field="ChildChannelRelationshipField"}
        {parents:title}
    {/parents}     
{/exp:channel:entries}

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.