1

I have this code

{exp:channel:entries
        channel="xxxxxx"
        disable="categories|category_fields|member_data|pagination"
        entry_id="{segment_2}"
        status="open|closed"
        track_views="one"
    }
        {url_title}

        {exp:channel:category_archive
            channel="yyy"
            style="linear"
        }
            {categories}
                {entry_titles}
                    {url_title}                                                     
                {/entry_titles}
            {/categories}
        {/exp:channel:category_archive}
{/exp:channel:entries}

Apparently, EE doesn’t know how to distinguish between the {url_title} of channel entries and category archive since it shows value of the channel entries {url_title} even inside the category archive tags.

I really think that EE should be able to namespace variables properly or at least provide some alternative names to avoid name conflicts like this.

But for now, is there a way to circumvent this?

EDIT:

  • The channel in the category_archive yyy is a relationship field
  • What I am trying to do here is to show yyy selected items grouped by category
1
  • Have you tried using {entry_titles:url_title}?
    – foamcow
    Dec 24, 2013 at 12:08

2 Answers 2

1

Until {entry_titles} gets its own dedicated {entry_url_title} (if ever) this is a typical situation where you could use an embed for the nested category_archive tag.

However, if yyy is already a relationship field, i wonder if there isn't a different approach to what you are trying to achieve.

0

You could use the VMG Nested add-on to prefix the variables on the category_archive tag. It's designed for nesting multiple instances of the same tag, but will also work for helping to namespace different tags with overlapping variables.

Your Answer

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

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