3
votes
Add an option to the advanced heading block to define a custom table of content text
The ToC element automatically generates the anchor tags based on the text of the headlines on the page.
In our case, we have quite long headlines, both for SEO and readability reasons. However, this leads to a ToC that is quite ugly – the text of the anchor tags is simply too long and wraps to multiple lines.
We would like to propose a new option to change the text of headlines in the ToC.
The easiest way to make this usable seems to be adding a new input field to the "advanced headlines" block. If this field is set, the ToC block uses the custom value defined here as the anchor text for this headline.
While this would mean that the ToC text can only be changed when used with the advanced headline blocks, it seems to be the easiest solution to our problem. As the ToC is generated dynamically on page load, adding a headline mapping to the ToC block itself doesn't seem feasable.


