0

I have a channel, products, with a URL structure like this:

/product/description/categoryA
/product/description/item-in-categoryA
/product/description/item-in-categoryA2
/product/description/item-in-categoryA3
/product/description/categoryB
/product/description/item-in-categoryB
/product/description/item-in-categoryB2
/product/description/item-in-categoryB3

When I am on, for example, /product/description/item-in-categoryB3, I want to indicate that categoryB is the current category. However, I cannot find a way to do this. I have tried {if active}, which never returns true whether I am inside channel categories or channel entries (using version 2.5x). I have tried inspecting the URL segment but I cannot rely on this when I am on an item's page as the category does not appear in the URL.

1

If you're successfully showing the entry's data then you should be able to call the categories from within the channel:entries tag loop with the categories loop.

{categories}{category_name}{/categories}

Is that working for you?

| improve this answer | |
  • Yes, that does work. Thanks. I'm now working on passing this around with Preload replace. – Michael May 21 '13 at 14:57

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.