כיצד עדיף לפצל את ה-select-kit של הקטגוריה לשני תפריטים נפתחים?

סיכום מבוסס בינה מלאכותית

The discussion revolves around redesigning a community forum to better distinguish between public “Spaces” and restricted “Groups” categories. manuel proposes splitting the category dropdown into two separate ones on the navigation bar—one for public spaces and one for groups—using the Category Groups component. awesomerobot references a prior solution for custom select-kit dropdowns, which manuel finds helpful. Johani suggests a simple code-based approach to create two separate dropdowns, one showing only unrestricted categories and another for restricted ones, noting that the composer should remain unchanged since restricted categories will already be hidden for non-members. manuel agrees this is a clean solution and confirms no changes are needed in the composer.

I’m re-designing the community forum of a volunteer project. We currently have public discussion categories and a few workgroups that are also set up as categories, but access is limited to certain groups. So right now these group-restricted categories are entirely hidden if you’re not a member of their group. But we want to give them more visibility to attract more participants.

To support that, I sketched a design that presents the public categories as “Spaces” and the restricted ones as “Groups”. I want to set up this distinction, because these two types work in two distinct ways, not only with regards to access but also how they are led and moderated.

At the bottom of the sketch is the category list and there I can easily set up this separation with the Category Groups component.

But I’d also like to offer two distinct access routes right on the Navigation bar:

Screenshot from 2022-01-26 21-10-27

So both “Spaces” and “Groups” would open a category drop-down list, only with different items. And I’m still wondering if there’s a way to achieve this without messing around tooo much. @Johani I think you shared an elegant approach how to add a custom select-kit recently? Not sure if that would work here, but I already can’t find it anymore.

Thanks for suggestions everyone :slight_smile:

5 לייקים

I recently posted about turning the new topic button into a custom select-kit dropdown, maybe that will help? Convert the New Topic button to a have a sub menu - #7 by awesomerobot

6 לייקים

Ah yes, that’s the topic I remembered but attributed to Joe. Thanks for sharing again @awesomerobot!

לייק 1

You can modify the category dropdown and have it only show unrestricted categories. You can also create another component that “extends” it and have that only show restricted categories.

All of that would only need a few lines of code, and it’s future-proof.

I do have a tiny question before we get into that. How would this work in the composer? Do you want that separation to also exist when users create a topic, or are you OK with having both “spaces” and “groups” being in the same dropdown in the composer?

2 לייקים

Yes, that sounds like a perfect straightforward solution for the dropdowns!

I think the composer will be better without tweaks. For users that can’t post in a restricted category, it shouldn’t show in the composer anyways.