Request: use exising “id” in h1, h2 headers
-
I am using TOC+ and it is working well. But, on some large pages, i have these sorts of constructs:
<h1 id="how-to">How to do "Random Stuff" you Love in 75 easy Steps ♥ ...</h1>
With this, I can send people directly to the section of the web page using # anchors in the form of site.com/pagename#how-to. I then put URL into other documents, like a pdf report.
With TOC+, it generates “id” that can be also be used with the URL ‘#’ function, but the anchor names are auto-generated from the h1’s full title:
<h1 id="how-to"><span id="how-to-do-8220random-stuff8221-you-love-in-75-easy-steps-hearts-8230">How to do “Random Stuff” you Love in 75 easy Steps ♥ …</span></h1>
Technically, I can do either anchor in a report or on the web and it will work. But, I would rather people just use the short name I give it.
Here is where the issue arises. People would click on the table of contents when it is displayed in the page. They can “right click / copy link” and use that in the future. But, it copies the TOC+ id name and not my succinct name. I would like TOC+ to use my given id if one is present.
Maybe do this processing around line 1382 of the toc.php code? if you see an “id”, then use that name in the span too? it would also be added to the hierarchical too? Maybe it will work.
- The topic ‘Request: use exising “id” in h1, h2 headers’ is closed to new replies.