XF 2.3 Use "Anchor links for headings" in templates (outside of BB-Code rendering)

nocte

Well-known member
From HYS:

Anchor links for headings​

Every time a heading is used within content, it now has an automatic anchor link generated which can be accessed on hover via the link icon that appears next to the heading:

hys_6_heading.png


This will allow you to link directly to headings within your content.

Is there a suggested way to use this in a template?

A workaround is something like this (tested in the template for help/terms/:

HTML:
{{ bb_code('[heading=2]Heading[/heading]', 'help', null) }}

It works, but is there a better way?

A template tag like this would be great:

HTML:
<xf:heading ...>My heading</xf:heading>

Does not seem to exist - maybe worth a suggestion.. 🤔
 
Back
Top Bottom