Automated navigation index within a page. Local Nav builds an in-page navigation index with smooth scrolling navigation and back to top options.
Local Nav is like an Autonav block, except it provides navigation within a long page. You specify a few parameters for how Local Nav picks out headings in a page. When the page loads, the Local Nav block will scan the page content and build an in-page navigation index of links within the page.
- Automated in-page navigation index
- Full control over which headings are indexed
- Single or multi-level indexing
- Smooth scrolling
- Optional #hash history for browser back/forward buttons
- Optional navigation to URL #fragment on load
- Back to top and back to index links
- Page order or Alpha sorted navigation index
- Indexes dynamic content including AJAX loaded content
- Many block templates
- Add as many Local Nav blocks as you like to a page
- For themes and templates - elements generated follow the same structure as an Autonav
- Opens relevant tab or accordion items when used with Magic Tabs.
Smooth scrolling uses a browser scrolling API with a recommendation for smooth scrolling. The scroll rate and whether it is smooth or snap are up to the visitor's browser and any preferences they may have configured.
There are other examples of Local Nav in use throughout this site. After all, that is one of the reasons why Local Nav was created! Have a look at Omni Gallery - Simple Examples of Display Widgets.
Requires php7.3+. Compatible with php8+.