Customizable Navbar Component

AI-generated summary

The discussion introduces the Customizable Navbar Component, a theme component for Discourse that allows users to add a customizable navigation bar at the top of the page. piffy explains that the component uses two theme settings: navbar_name for labels and navbar_location for URLs, which are matched by position to create links. It includes special features such as a default navbar for non-logged-in users (with options like About, Rules, and Login), admin-only visibility for links containing /admin, and automatic notification bubbles for /messages, /new, and /unread links. The component is hosted on GitHub, with installation instructions provided via Discourse’s official guides. piffy also includes visual examples demonstrating how the navbar appears in practice.

Background

Need quick access to custom links (like Home, Rules, or Badges) directly in a navigation bar? This theme component makes it easy to add and configure a custom navbar that shows up at the top of the page.

How to install

:information_source: Summary Adds a customizable navbar that displays links defined in theme settings.
:hammer_and_wrench: Repository GitHub - ScottMastro/discourse-customizable-navbar: Customizable navigation bar for Discourse · GitHub
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

What it does

This component lets you define a custom navigation bar using two theme settings:

  • navbar_name
    A list of labels that will be displayed in the navbar.

  • navbar_location
    A list of URLs corresponding to each label above.
    Example:

The two lists are matched by position, so the first navbar_name entry links to the first navbar_location, and so on. URLs can link to anywhere.


Special cases

  • If a user is not logged in, the component automatically uses a default navbar: About, Rules, and Login (or optionally hide it for anonymous users)
  • Any link containing /admin will only display for admin users.
  • The /messages, /new, and /unread locations automatically display notification bubbles showing live counts for new/unread private messages or topics.

Example

With the settings above the navbar will render as:

4 Likes