THIS THEME COMPONENT IS BEING DEPRECATED
It has now been superseded by the Navigation Menu Display Control component
|Navigation Menu Modifier
|How to install a theme or theme component
|New to Discourse Themes?
|Beginner’s guide to using Discourse Themes
Install this theme component
update: component has been renamed to reflect the updated naming convention see this fix: FIX: Update sidebar to be navigation menu (#22101) · discourse/discourse@2effcaa · GitHub
i have seen a number of inquiries in recent weeks about customizing or hiding certain parts of the navigation menu (sidebar), so i put this theme component together to make some of those things a bit easier to do, as well as give users some other options with the navigation menu configuration.
this component allows the following:
- specifying navigation menu background color
- changing navigation menu header text sizes and colors
- changing link text sizes and colors for the navigation menu
- hiding of specific sections and links from regular or anonymous users (including whole Community section, as well as anniversary and birthday links from More section)
- shaping or hiding of category bullets in the navigation menu
- hiding of lock badge icon from secure categories
- changing side-bar link icon colors
- changing navigation menu current link colors
- hiding a custom section from either anonymous or regular users.
- update: hiding the whole navigation menu from anon users
- update: hiding of More… section from anonymous or all users
keep in mind some of the settings will override your existing theme for navigation menu colors and font sizes, so you may wish to download more than one component if you use dark and light themes and want to override some of your existing theme’s colors. you can also use your existing color variables so that you can adapt it to any existing theme for light and dark mode.
it assumes you have not used text-replacement to rename any applicable sections (if you have replaced some section text, you will need to revert those text replacements for this theme to work on those particular sections).
of course you do not have to use all the settings, so if you are just wanting to hide some sections or change font colors and sizes in the navigation menu you can do that.
this theme also assumes you are using the sidebar version of the navigation menu and works in both desktop and mobile views (i don’t think it will work for hamburger drop down mode and i haven’t even tested it for that).
color settings can be in hexidecimal, css color name format - W3 CSS Color Reference, or theme color variables.
i will add more options to this component as the Discourse Team continues on it’s navigation menu development path.
possible future additions are hiding custom sections from anonymous users and user-configurable transparent side-bar background.
edit: have since added the ability to hide a custom section from either anonymous users or regular users (visible to staff only).
edit: updated to include functionality to hide the “More…” drop down section under the top level navigation sidebar menu from from either anonymous or all users.