Navigation (sidebar) menu display control

:information_source: Summary Allows displaying sections and links for staff, logged-in and anon users
:eyeglasses: Preview Preview on theme creator
:hammer_and_wrench: Repository https://github.com/Lillinator/navigation-menu-display-control
: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

Description

The Navigation Menu Display Control theme component allows for the display of various default sections and links for staff-only and/or logged-in users only. You can also specify custom sections or custom links (placeholder names are included). Additionally, there is a setting for displaying a custom menu section for anonymous users only, as well as settings for setting the order of the default sections (category, tags, chat, channels, messages) . The sections and links in the settings are lists that include defaults that can be added or removed as you require, as well as as many custom sections or links as you wish to add.

Settings

:point_right:t2: Note that for the list settings, the defaults can be removed and new custom sections or links added. The defaults are just for a starting point and should be configured to suit your forum. Also, for custom menu sections, they must be visible globally when you set them up (the Make this section public and visible to everyone checkbox must be enabled).

The top section is called “community” in the code, and this is reflected in the default settings as well. Some of the defaults refer to links installed with plugins, but they will not affect the functionality if you do not have the respective plugins installed (for example, docs, anniversaries and birthday links).

There are also settings that override each other - having a specific link in More visible to logged-in users will be overridden by the More drop down setting being visible only to staff.

Setting Name Description
show these sections for staff only List of sections to show for staff only. Can include custom sections with “Staff Menu = staff-menu” naming format.
show these sections for logged-in only List of sections to show for logged-in users only. Can include custom sections with “User Menu = user-menu” naming format.
show these links for staff only List of links to show for staff only. Can include custom links with “Staff Link = staff-link” naming format.
show these links for logged-in only List of links to show for logged-in users only. Can include custom links with “User Link = user-link” naming format.
show more for staff only Check-box to show the More drop-down section for Staff only.
show more for logged-in only Check-box to show the More drop-down section for logged-in users only.
show custom for anon only Text field for a custom menu section so show for anonymous users only (hides for logged-in users).
show navigation menu to logged-in only Check-box to show the entire navigation sidebar menu to logged-in users only (hide from anonymous users).
hide custom menus globe icon Hide the globe icon from staff for custom menu sections (not visible to non-staff by default).
default menu section ordering Allows re-ordering of the default menu sections (does not apply to custom menus)

Screenshots

Settings for staff and logged-in only sections, and staff-links

Settings for logged-in links, More drop-down, and custom anon menu

Settings for globe icon, entire navigation menu, and order of default menu sections


To-do: Build Navigation Menu formatting theme component to replace the formatting functions being deprecated by the Navigation Menu Modifier component.

For custom group-specific navigation sidebar menu sections, please use the Group Menu Sections theme component.

12 Likes

One observation :slight_smile:

A preview link using https://theme-creator.discourse.org/ would be nice so we could try it without having to install it on our instance. :slight_smile:

4 Likes

Updated this component with option to hide the globe icon for custom menu sections.

I will do this as soon as the Theme Creator is fixed :grin:

3 Likes

Added a section to allow re-ordering of the default menu sections.

edit: also just added a preview link to theme creator :slight_smile:

2 Likes