3

I have a channel with a single relationship field. In my template, I want to access the relationship's list of categories. Unfortunately, this does not work: (example simplified to illustrate my point)

{exp:channel:entries channel="parent"}
    <h1>{title}</h1>
    <p>{relationship_field:categories backspace="2"}{category_name}, {/relationship_field:categories}</p>
{/exp:channel:entries}

Any ideas on how to make something like this work?

6

I believe you need to have your categories tags set within the relationship tag pair like:

{exp:channel:entries channel="parent"}
    <h1>{title}</h1>
    {relationship_field}
        <p>{relationship_field:categories backspace="2"}{category_name}, {/relationship_field:categories}</p>
    {/relationship_field}
{/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.