Closed stephenmeehanuk closed 1 year ago
It'd be useful to have a way to generate ID attributes in bard headings
We can do this to generate a table of contents (found this in the Statamic Discord),
{{ headings = test_bard | raw | bard_items | where:type:heading }} <ul> {{ headings }} <li> <a href="#{{ content | bard_text | slugify | safe_truncate:30}}">{{ content | bard_text }}</a> </li> {{ /headings }} </ul>
But the anchors don't work, because the headings in the bard fieldtype don't have ID attributes.
Could this option be added to a future release?
Check out https://statamic.com/addons/jacksleight/bard-mutator
One of the examples are how to add ids to headings:
It'd be useful to have a way to generate ID attributes in bard headings
We can do this to generate a table of contents (found this in the Statamic Discord),
But the anchors don't work, because the headings in the bard fieldtype don't have ID attributes.
Could this option be added to a future release?