Category Groups component

This component allows you to assign categories to groups, which are then used to sort and collapse categories on the categories page.

:warning: Important things to note:

  • This only works with the site setting desktop category page style set to boxes with subcategories (as it replaces that category page template).

  • The category collapsing works using your browser’s local storage, so the collapsed state will not be remembered between different devices.

:wrench: This theme comes with some settings:

  • category groups - this is how the groups are configured, the setting is formatted as: Category group name: category-slug, category-slug-2, category-slug-3. The category slug is the name of the category as it’s seen in URLs… usually all lowercase with no spaces.

  • show on mobile - if you want to use default category page on mobile, disable this

  • show ungrouped - this will show all categories not assigned to a group in an “Other” group. The name of this group is configurable.

  • fancy styling - these are some custom styles I added, they stray from our defaults so if you’re working on your own theme you may want to disable this.

24 Likes

This is pretty cool. Is there a way to show a subcategory? Ie

My main Parent category
Main slug)

Has 2 subs
sitenews(slug)
sponsors (slug)

I have hidden the subs in Hamburger.

I would like to create a collapsable Category header
Main: sitenews, sponsors

When I try that the subs do not show

Url looks like c/main/sitenews

1 Like

Is there a way to mod this to show Subcategories in Boxes instead of the Parent Category?

1 Like

No, this will only work with top level categories at the moment (but the category box will show the related subcategories as it does by default).

3 Likes

Thanks still an awesome component. I am guessing to get that added functionality would need a more complete category view replacement?

Very clean-looking!

Requests:

  • As already mentioned, ability to list subcategories directly on categories page would be ideal.
  • Ability to set default collapse state.
  • Remember user’s collapse state in account settings.
  • Subcategories listed inside grouped parent category are grouped as “Other” - should be grouped as parent category’s group.

Thanks for this TC!

2 Likes

There is another component that can group categories and/or subcategories grouped under headers. It is in the Air Full Theme called Modern Category Boxes.

However it could use the collapsible feature and more importantly @awesomerobot 's really cool option to setup category lists for groups.

As for the collapsed stated being remembered woild require additional work as Kris mentioned that this one uses the browser and as such cannot remember last state.