visuellverstehen/statamic-anchor-navigation
| Install | |
|---|---|
composer require visuellverstehen/statamic-anchor-navigation |
|
| Latest Version: | v1.1.0 |
| Laravel: | 12 · 13 |
| License: | MIT |
| Last Updated: | Jun 10, 2026 |
| Links: | GitHub · Packagist |
Statamic Anchor Navigation
A Statamic addon that provides a custom tag for creating an anchor nav for all headings generated by the bard editor.
Features
- Extends the TipTap heading node and adds a slugified ID to all configured heading levels (defaults to h2).
- The
{{ anchor_navigation }}tag makes it easy to build an anchor navigation for all headings within your bard content.
How to install
Run the following command from your project root:
composer require visuellverstehen/statamic-anchor-navigation
How to use
Include the {{ anchor_navigation }} tag in your template and supply the field handle of your bard field.
<ul>
{{ anchor_navigation from="bard" }}
<li>
<a href="#{{ id }}">{{ headline }}</a>
</li>
{{ /anchor_navigation }}
</ul>
You also specify the entry from which you want to render the anchor navigation.
<ul>
{{ anchor_navigation from="bard" :entry="specific_entry" }}
<li>
<a href="#{{ id }}">{{ headline }}</a>
</li>
{{ /anchor_navigation }}
</ul>
You can get the amount of headings found within the content with the count tag:
{{ if {anchor_navigation:count from="bard"} > 0 }}
...
{{ /if }}
Configurations
You can define which heading levels should be included in your anchor navigation. Level 2 headings are set as a default.
'heading' => [
'levels' => [2],
],
More about us
License
The MIT license (MIT). Please take a look at the license file for more information.
Related Packages
A useful helper to add CSS classes to all HTML tags generated by the bard editor...
A Statamic tag for building HTML-only responsive images.
A Statamic search transformer for bard and replicator fields.
Track where your Statamic assets are used to make moving, replacing and deleting...
Version History
| Version | Released | License |
|---|---|---|
| v1.1.0 | MIT | |
| v1.0.0 | MIT |
Pre-releases (12)
| Version | Released | PHP | License |
|---|---|---|---|
| v0.3.6-beta | ^8.1 | MIT | |
| v0.3.5-beta | ^8.1 | MIT | |
| v0.3.4-beta | ^8.1 | MIT | |
| v0.3.3-beta | ^8.1 | MIT | |
| v0.3.2-beta | ^8.1 | MIT | |
| v0.3.1-beta | ^8.1 | MIT | |
| v0.3.0-beta | MIT | ||
| v0.2.0-beta | MIT | ||
| v0.1.3-beta | MIT | ||
| v0.1.2-beta | MIT | ||
| v0.1.1-beta | MIT | ||
| v0.1.0-beta |