This page documents the current sidebar behaviour implemented by:
user/themes/members-hub/templates/partials/sidebar.html.twig
The sidebar gives members a browsable page tree while keeping only the active branch open by default.
It is intended to support clarity, not to expose every page at once.
The sidebar starts from the visible top-level Grav pages.
Rules:
/ is excluded.sidebar_hide: true is excluded.Examples of domains include:
The sidebar is an accordion tree.
For each page:
Current maximum depth:
6
For each top-level domain, the sidebar attempts to add a "See more..." directory link at the bottom of the expanded branch.
The default directory route is:
/{domain}/{domain}-directory
This can be overridden in the domain landing page front matter:
sidebar_directory_route: /custom-directory-route
sidebar_directory_label: Directory
If the directory page is not found, no directory link is shown.
Any page can be removed from sidebar rendering with:
sidebar_hide: true
This applies to normal rendering and child expansion.
The sidebar includes a Reset tree button.
It collapses all sidebar branches by adding the hidden state back to child containers and setting toggle buttons to aria-expanded="false".
The reset behaviour is supported by:
user/themes/members-hub/js/cc-reset-tree.js
When the Learn2 sidebar search highlights a matching navigation item, the sidebar opens the matched branch and its parent branches so the highlighted item is visible.
| Key | Where used | Purpose |
|---|---|---|
sidebar_hide |
Any page | Removes the page from sidebar rendering. |
sidebar_directory_route |
Domain landing page | Overrides the auto-detected directory link route. |
sidebar_directory_label |
Domain landing page | Overrides the default See more... directory label. |
The current implementation does not use pinned pages or sidebar_pin ordering.
If pinned sidebar behaviour is introduced later, this page should be updated at the same time as the Twig template.