Enhanced category-box display component


I’ve worked quite a lot on a new category-box homepage for my community’s forum. It’s quite specific for our needs and then may not be useful for a lot of people, but one might take ideas from it.


Our specific usecase

We have a community that deal with a lot of broad topics. We federate local NGOs that have their own members, and we do have autonomous groups, each of them are performing one or multiple actions that they need to advertise and they also need a private space to talk about them.

A significant part of our members are old persons and any action that is more than 3 clicks long is very hard for them (so managing notification level the usual way is not doable for them).

The community large enough for us to need a strong sorting system, but the users digital skill and willingness is quite low so we need to keep something as easy and explicit to use as possible.

Topics organization

The top level categories are used as hosts for the community main purposes.
Any topic that does not refer to a group belong to the closest top-level category, and its main points may be labeled with tags. A tag is mostly but not necessarily contained in a top-level category.

Each NGOs and local groups does their announcements in a public subcategory of the most obviously related top-level category and quietly works in a private subcategory.

Thus, a user can easily find all the content about one of our main purpose (top-level category), about one specific topic (a tag that could be transversal to multiple purposes), about one specific group (a public subcategory), etc.


  • Highlight each category to make them feel as whole section of the website.
    • Write with bold font and add an icon to anything one can click on, so it’s easier to focus on the important stuff.
  • Add additional stuff for each category:
    • the usual amount of posts
    • the notification level selector
    • a link “Click here to see all posts relative to that domain” in order to be extra explicit
  • Add tags related to that category
    • add a header to make very explicit these things are the main themes we are discussing about
    • these tags are selected with a theme setting
    • the tags display is made so that tags actually look like tags, so user understand what we are talking about when we use the word «tag».
    • note : the display is enhanced by the Tag icon component
  • Add header to subcategories to make extra explicit that these categories are for announcement, and an other one to make extra explicit that these subcategories are private (yes, there is a lock and any medium level user understands. But…)
    • note : the display is enhanced by the Category icon component
  • Most of these features are toggle-able.


Note : this component is still Work in Progress. I’m still updating it, correcting CSS bug that I’ve propagated elsewhere, etc. Please show mercy and let me know if something looks odd.

Install the component as usual. How do I install a Theme or Theme Component?
Repository : https://framagit.org/oca/discourse-theme-category-homepage.git

Road map for future enhancements

Fix the very large amount of CSS bugs.
Fix the thing that force displaying for separator/header for subcategories even if there is no public or no private subcategory
Do an as-nice category page displaying subcategory boxes and topics.
Update everything as soon as the Discourse team decide that sub-sub-categories might be a thing (I know, let me hope…)

I’m open to new feature suggestions, but I will add them in this component only if they serve my very specific usecase or are very easy to do. Any new feature added will be toggle-able.


No problem, that’s done.


Thank you so much for creating this great component, it is awesome! :awthanks:

One question; is it possible to have it active with the category setting “Boxes with featured topics”? If not, is that a feature that would be possible to implement, or do you foresee any issues with it?

All the best, and again much appreciated for creating this! :pray:


Hey, thanks.
It’s not possible as it is right now (it’s not the same box that is tweaked) but it’s totally something that can be done easily. I can help you doing it if you want to talk by MP, or I might give it a look when I have some time, but for that, I’d need you to give me a sketch of what you’d like (and how stuff would be displayed).


Fully understood.

For me, the killer feature with your component is adding the notification status bell for each subcategory, as well as the simple yet powerful way of giving the freedom to change column width. To my use case, making those features available with “Boxes with featured topics” enabled would serve my particular needs brilliantly.

I am a rookie but would be glad to give it a shot to implement. Appreciate any pointers, but will inspect other category box components and hopefully be able to figure out how to do it. I will have time to wrap my brains around this in a couple of weeks and will update here if I make any progress.

All the best.


I’ve had trouble to do that but it’s finally not that hard.

In a theme component, modify your handlebar component to have this code:

{{#each categories as |c|}}
  ...some stuff before the bell...

    onChange=(action "changeCategoryNotificationLevel" c)

  ...some stuff after the bell...


If you don’t know how to do it, Johani’s tutorial is a perfect “first place to look”.

And if you find how to do the same with tags, please tell me ! I can’t find a way to do it.


@oca I made a recent change in core that causes this theme component’s SCSS to fail compilation. The fix is quite simple, these two lines need to be removed from the stylesheet:

@import "common/foundation/variables";
@import "theme_variables";

(The second line causes a SCSS compilation error because that file no longer exists. Both lines are unnecessary, though, the core and theme variables are now injected before any SCSS file is compiled.)


Thanks for the explanations.

That’s removed.


Nice work!, Does this not work on Mobile?



1 Like

i wish i could figure out how to make this work on mobile, it looks cool on desktop but if it’s not usable on mobile then it’s kinda pointless, i’m sure there is some simple way but i’m not sure how, does any one have any suggestions?

1 Like

Sorry for the multipost

i have managed to hack together Categories Layout Override to work for mobile only

then by using my modified version GitHub - CyanLabs/discourse-categories-layout-override

i can now specify the override as categories_boxes
which then forces the mobile view in to the required view for this plugin to work



Obviously not a ideal solution but it works, so until someone has a better solution here is a workaround :slight_smile: