Discourse Group Sidebar Menus

:information_source: Summary Create custom sidebar menus with access restricted to selected groups
:eyeglasses: Preview Join this Theme Creator group and then preview here
:hammer_and_wrench: Repository https://github.com/Lillinator/discourse-group-sidebar-menus
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

:woman_technologist:t2: Overview

This Discourse theme component gives forum administrators the ability to create custom sidebar menus that are only accessible to members of selected groups.

Key Features:

  • Group-based access control - Menu sections only render for authorized users
  • Admin UI configuration - All settings for creating group menu sections are in the theme component admin UI
  • Multiple sections - Create unlimited menu sections for different groups (within reason)
  • Client-side security - Unauthorized users cannot see menu sections in DOM, web inspector, or safe mode
  • Admin quick-edit link - Pencil icon in menu headers links admins directly to component settings

:briefcase: Some Use Cases

  • Staff-only resources and quick links
  • Category moderator shortcuts
  • Custom group portals (project teams, study groups, book clubs, VIP members)
  • Links to parent or partner website resources

:gear: Settings

Menu Sections (menu_sections)

Opens the object settings editor to configure custom group menu sections.

Section Properties

Property Description
Menu title Title displayed as the sidebar section header
Allowed groups Groups permitted to view this menu section (max: 20 groups per section)
Menu links Collection of links to display in this section (max: 20 links per section)

Link Properties

Property Description
Icon FontAwesome icon name (e.g., circle-info, star, user-group). May need to be added to Admin > All site settings > svg icon subset
Text Display label for the link
URL Link destination - supports both relative paths (/faq, /my/preferences) and absolute URLs (https://example.com)

:wrench: Installation and Configuration

  1. Install the theme component as per Installing a theme or theme component.
  2. Go to the Objects setting editor
  3. Click the + new_menu_section button to set up the first custom menu section
  4. Give the new menu a title in the Menu title field, and then select the groups you want to have access to it.
  5. Click the + new_menu_section to add another section, or Save changes.
Admin configuration screenshots with example set up

Fresh install - go to Objects setting editor.

Example scenario with 2 custom menus and 3 users, one who is an admin:

  • @Catra loves cats and is a member of pink group, which will have access to the Cat Menu :grinning_cat:
  • @HelloKitty likes dogs and is a member of purple group, which will have access to the Dog Menu :dog_face:
  • @Lilly is a member of purple because she owns a dog and dogs are better. However, she is also a forum admin, and admins will have access to the Cat Menu because cats need more supervision :dog_face: :cat_with_wry_smile:

Create a new custom menu - for our example, create Cat menu and add the groups allowed to have access to it - pink and admins. Then click the + menu_link button to set up the links for the new menu.

Add the menu links - 1. Fontawesome icon name, 2. text to display for the link, and 3. the URL, relative or absolute. Click the + menu_link button to add another link to this menu.

Create another custom menu section called Dog menu, give only group purple access and configure the links:

Screenshots of resulting sidebar menu access

User @Catra has the Cat menu! :grinning_cat:

User @HelloKitty has the Dog menu! :dog_face:

Admin user @Lilly has both menus and can edit them! :smiling_cat_with_heart_eyes:

Configuration Example

Menu Title: "Staff Resources"
Allowed Groups: staff
Links:
  - Icon: wrench
    Text: Moderation Guide
    URL: /t/moderation-guide/123
  - Icon: chart-line
    Text: Analytics Dashboard
    URL: /admin/dashboard

:light_bulb: Important Notes

Admin Access

Admins must add themselves to groups to see menus configured for those groups. Admin status alone does not grant access to all custom menus. This is intentional! Also, admins who belong to a menu’s allowed groups will see a pencil icon in the section header that links to component settings.

Group Configuration

  • The everyone group is not supported - Use the native sidebar footer UI to create global custom menus for all users, including anonymous visitors.
  • Maximum of 20 groups per menu section. If you need more, create duplicate sections with different group assignments.
  • Users in multiple groups will see all menu sections they have access to.

Testing & Organization

Use test accountsto verify correct access for different group combinations. Keep track of your menu configurations to avoid confusion as complexity grows; an access matrix or similar documentation is recommended for larger forums with many groups.

Security Considerations

This component provides UI-level access control. It controls menu access, not resource access - it is not a replacement for category security permissions.

What this component protects:

  • :white_check_mark: Menu sections cannot be accessed by unauthorized groups of users
  • :white_check_mark: Links not discoverable via inspector/console/safe-mode
  • :white_check_mark: Clean UX without menu clutter

Administrator best practice:
Configure any linked category’s security permissions and the relevant group membership separately before setting up this component - plan your configuration. Administrators are responsible for ensuring links to outside resources are appropriately authorized for selected groups.


Other Notes :pen:

  • This component is compatible with Discourse Sidebar Menu Reorder, which was used to put the two example menu sections in the screenshots at the top of the sidebar. Simply use the custom menu section title in slug format eg: cat-menu.
  • This was a collaborative project with @Moin - her input, inspiration and feedback were invaluable.
7 likes

I seem to be getting a 404 on the repo.

EDIT: All good now!

1 like

haha try again. forgot to make it public! :laughing:

4 likes