0

I am working on a feature where I need to get every entries category and that categories parent category. This is leading to a lot of DB queries. Is there a way to get the category of an entry and that categories parent. Ultimately I am after just the category url title.

Psuedo code
    {exp:channel:entries}
      {entry:category:url_title}
      {entry:category:parent_category:url_title
    {/exp:channel:entries}
1

Would using the channel categories tag allow you to get the results you need?

{exp:channel:categories 
    channel="your_channel"
    show_empty="no"
    parent_only="yes"
}
    {category_url_title}<br>
{/exp:channel:categories}

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.