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>

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

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

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.