Tags:
create new tag
view all tags

Question

Is there a way to set a custom anchor that gets used by the TOC?

The problem I am having when there are multiple heading with the same text. Each will have the same anchor and clicking on any of them in the TOC will always goto the first occurance.

Example. Both Heading A and B have Sub A and B. There ends up being duped archors for each Sub.

Heading A

Sub A

Sub B

Heading B

Sub A

Sub B

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: SunOS 5.9
Web server: Apache 2.2.3
Perl version: 5.8.8
Client OS: Linux
Web Browser: Firefox
Categories:  

-- TWikiGuest - 29 Nov 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Yeah - that's a known shortcoming.

What is usually done is to disambiguate the subheadings with a comment (see VarTOC2). I usually write the comment in the beginning of the heading, quoting the top level head. You'll see the effect in the toc which you included:

Heading C

Sub A

Sub B

Heading D

Sub A

Sub B

In a long topic this has the the additional benefit that when editing you know exactly where you are smile

-- HaraldJoerg - 29 Nov 2006

Haralds workaround is correct, but I think TOC should handle this automagically, shouldn't it?

-- FranzJosefSilli - 29 Nov 2006

Yes, that has been stated in TocBreaksOnIdenticallyNamedSections.

-- PeterThoeny - 29 Nov 2006

Change status to:
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2006-11-29 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.