0

I am pulling a series of entries from a Channel that has about a dozen categories. I need to be able to direct each entry's "read more" link to a template group that bears the same name as the category_url_title. I have reviewed the entries here and the ee documentation, but I can't figure out how to pull that information in using the channel entries tag.

Ideally I would like to do something like this:

{exp:channel:entries channel="features"}
  {summary} <a href="{category_url_title}">read more"</a>
{/exp:channel:entries}

What is the correct way to "pull" the category from the entry and reference it there?

Thanks.

2 Answers 2

4

Category variables are only available within the {categories} loop.

{categories limit="1"}{category_url_title}{/categories}
0

I've also found that if you're trying obtain the category_url_title of a related entry, it can be done like this:

{related-products:categories limit="1"}{category_url_title}{/related-products:categories}

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.