I'm trying to get the category description and some custom fields of the currently "active" category. By "active" I mean based on a URL-segment. So if my category-structure looks like this:

  • websites
    • design
    • development
    • information-architecture
  • brochures

And my url is http://www.mydomain.com/portfolio/category/development i want to get the custom fields etc. from the category websites (because it's the top-level parent for development). What's the best way to do this?


  • Steven

1 Answer 1


I believe ExpressionEngine register the category on display as the active category, so from your example, the active category is 'development' NOT 'websites'. It sounds like you want to be able to pull data from the parent category.

I think the easiest way to accomplish this is to find a third-party add-on. You could probably do it with custom queries, but that may get complicated.

GWcode Categories offers very flexible ways to pull data from categories. You could definitely use that, though it maybe overkill for your needs. But once you get use to it, you may find you want to do more with categories more frequently. Plus its free.

Primary Categories by Solspace should also allow you to accomplish what you want. It's not free, but works more specifically on the issue you describe.

Category Parents Works directly on the issue at hand. Grabs data from the parent category.

Low Seg2Cat may also work. It's free, and allows for you to work with url segments to grab categorical information.

There are a lot of add-ons that deal with categories, over 70 at Devot-ee, you can go for one that works specifically on your issue (parent-child relations) or find a nice all purpose tool like GWCode Categories or others.

Either solution will work. If your site is pretty simple, I recommend just going with something like Category Parent, if you think you'll need more flexibility with categories across the board, then look at GWCode.

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.