4

In my code below I'm trying to list the category_url_titles within data-type. This is returning all the categories for that channel, but I only want to show the categories assigned to that entry. I thought maybe there would be an entry_id="{entry_id}" thing for the channel categories tag, but there isn't. Any ideas?

    {exp:channel:entries channel="locations" dynamic="no"}
    <a href="{title_permalink=locations/details/}" data-type="{exp:channel:categories style="linear" }{category_url_title} {/exp:channel:categories}"></a>
    {/exp:channel:entries}  

1 Answer 1

6

Within your channel:entries loop, use the categories loop:

data-type="{categories backspace="1"}{category_url_title} {/categories}"
1
  • Wow, I've been scanning the EE docs for a while and must have kept skipping that. Thanks! Dec 19, 2012 at 15:06

Your Answer

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

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