| Summary | Allows reordering default and custom sidebar menu sections | |
| Preview | https://discourse.theme-creator.io/theme/Lilly/discourse-sidebar-menu-reorder | |
| Repository | https://github.com/Lillinator/discourse-sidebar-menu-reorder | |
| Install Guide | How to install a theme or theme component | |
| New to Discourse Themes? | Beginner’s guide to using Discourse Themes |
Install this theme component
Introduction
I have seen a number of requests from Discourse admins wanting to reorder sidebar menu sections, including global custom sections. Since it currently isn’t very intuitive or straightforward for most people to do with CSS, and doing so can be difficult to manage and make changes to, I created a theme component that makes it much easier in the admin UI.
Overview
This Discourse theme component lets administrators reorder their forum’s sidebar menu sections in the admin user interface, including all the default sections as well as any globally visible custom sections.
The component works for both desktop and mobile sidebar views, as well as header dropdown mode (although ideally, it is made for sidebar mode).
Installation & Configuration
- Install this theme component as per Beginner’s guide to using Discourse Themes.
- The
communitysection refers to the default top section of the sidebar - the menu with the Topics header and includes the More dropdown submenu; it is recommended that no more than one or two sections (default or custom) be moved above thecommunitysection. - Do not delete any of the default sections in the setting, or they will be out of order (you can always add them back or reset the setting).
- The best way to configure this component is to have the component admin screen with the reorder list setting in one browser window, and the forum sidebar view as a test user in another one beside it; reload the page after every menu section order change in the list.
Settings
| Setting | Description |
|---|---|
Sidebar_menu_order |
A list setting that contains the default menu sections. community (which is the default top section in the sidebar and includes the More dropdown submenu). Reorder the menu sections with the up and down arrows on the side. Globally visible custom sections can be added as well - use the menu name slug (e.g., for a custom menu titled Test Menu, add test-menu in the setting). |
The theme component initially has the default settings. Admins need to add any global custom menu sections they wish to mix into the ordering list, and then reorder them along with the default sections.
Screenshots
The screenshots below show the community section, and two example custom menu sections called “Dev Links” (dev-links) and “Toolbox” (toolbox) as they appear in the component admin panel on the left, and to a regular user on the right. The arrows to move a menu section up and down in the component admin setting are shown in the small red box.
Here, the setting is configured to show the default categories section above the community section (collapsed and expanded modes):
Here is an example using two custom sections: one called dev-links that is above the default community section, and another called toolbox that sits below the default tags section.
Also, note the section called inbox-section in the above admin screenshot - this is the Messages section that the Messages section for sidebar component inserts into the sidebar (under the toolbox custom menu above), showing that this component can be used to move it around as well.
In Addition, this theme component can be used along with Group sidebar menu sections and Indented subcategories components (see in screenshot above).
Notes
- After adding new global custom sections to the
sidebar_menu_ordersetting, forum users will see the new correct menu order when they reload their browser or collapse/expand the sidebar. - Creating new global custom menu sections while this component is enabled can result in temporary duplicate sections for the admin until the sidebar is re-rendered, either with a page refresh or by collapsing and expanding.
- User-created custom menu sections will always appear at the bottom of the sidebar for that user, but are otherwise unaffected.
- If the
Admin -> All Site Settings -> Chat Separate Sidebar Modesetting is set toAlways, the chat button will appear as usual at the bottom, and the component will ignore the default chat menu sections (chat-dms,chat-channels, andchat-search).







