2

We have 3 channels called chapters, districts and groups. Channel chapters has a multiple relationship field for districts, channel districts has a multiple relationship field for groups, channel groups has all the groups.

We assign members to groups.

At a point (when a member logs in) we know the group and like to know what district and what chapter are assigned.

In our test here we are putting an entry_id in the group channel to get a certain group out. And then we get the district with the first parents tag.

But the second parents tag for channel chapter does not work.

How would we get the chapter then? Would we need an embed or ...?

Thanks for some advice.

{exp:channel:entries
   channel="gruppen"
   entry_id="1"
}

  {parents field="gruppen"}
      Bezirk (district): {parents:title}
      {!-- The following doesn't work --}
      {parents channel="bereiche" field="bezirke"}
            Bereich (chapter): {parents:title} 
      {/parents}
  {/parents}
{/exp:channel:entries}

1 Answer 1

2

You can actually accomplish this by further namespacing the Relationship tag pairs:

{exp:channel:entries channel="gruppen" entry_id="1"}
  {parents field="gruppen"}
      Bezirk (district): {parents:title}
      {parents:parents channel="bereiche" field="bezirke"}
            Bereich (chapter): {parents:parents:title} 
      {/parents:parents}
  {/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.