Categories Layout Override

Normally the desktop categories page layout is set via a global site setting. When added to a theme, this component will allow you to override the layout of the categories page for that specific theme.

Installation

Repository Link
https://github.com/tshenry/discourse-categories-layout-override

This component can be installed more than once if necessary. If you do this, it is recommended to modify the name so you can keep track of which layout is associated with each copy of the component.

If you are unfamiliar with theme components and how to install them, check out the theme installation guide . And if you’d like to learn more about Discourse themes, take a look at this guide .

17 Likes

thank you for this.

Topics do not populate in the “category boxes with topics” option when using this extension for some reason. Any thoughts?

1 Like

Unfortunately the category page layouts that are supposed to include topics are not. There are some aspects of the code that will only include the relevant topics if the global site setting has been set. At this time, a plugin would be required to include all of the options.

With that said, this component should work without issue for:

  • categories_only
  • categories_boxes

With some minor tweaking, I should be able to add the following to the “working without issue” list:

  • categories_and_top_topics
  • categories_and_latest_topics

These are the two that look like they will require a plugin:

  • categories_with_featured_topics
  • categories_boxes_with_topics

:bulb: What you can do to work around this is set your desktop category page style site setting to one of the two above, then use this component to change the layout for any themes that require it.

I’ll work on getting the “top” and “latest” layouts working and update this topic when that’s done.

Thanks for pointing out the issue!

1 Like

Cool, thanks for sharing this

1 Like

I’ve refactored this component a little since some recent changes to core would cause it to break.

DO NOT UPDATE the component if your Discourse site is not up-to-date.

In addition to the refactor, this component will now work without issue for:

  • categories_only
  • categories_boxes
  • categories_and_top_topics
  • categories_and_latest_topics
3 Likes