Enhanced category-box display component

discourse-theme-category-homepage

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.

After/Before


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.

Features

  • 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.

Install

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.

26 Likes

No problem, that’s done.

7 Likes

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:

3 Likes

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).

4 Likes

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.

3 Likes

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...

  {{category-notifications-button
    value=c.notification_level
    onChange=(action "changeCategoryNotificationLevel" c)
  }}

  ...some stuff after the bell...

{{/each}}

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.

5 Likes

@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.)

6 Likes

Thanks for the explanations.

That’s removed.

6 Likes

Nice work!, Does this not work on Mobile?

Mobile

Desktop

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
image
which then forces the mobile view in to the required view for this plugin to work

Tablet

Mobile

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

9 Likes

Thank you for the customization of the theme-component Categories Layout Override, but can you share with me the customization of the theme-component Enhanced category-box display component? I visited your website, and I appreciate your use of “background-color” for class=“category-logo”

1 Like

Thank you for the recent customizations, however with the recent upgrade to ver 3.2.0.beta 4-dev the theme component did not work. I also hope that mobile display customization will be integrated into the core of discourse. Because I want a synchronous experience from desktop to mobile

1 Like

No idea how to fix it unfortunately.

2 Likes

Recently when upgrading to the latest version, the theme component “discourse theme category homepage” no longer works on mobile and I keep getting the following message

This is my site Categories - Business Lab

1 Like

Hi @hoangphuctran93, I’ve moved your post into the relevant theme component topic (cc @oca)

4 Likes