Tags:
create new tag
, view all tags
It would be convienent to be able to easily create an internal link to a particular heading within a topic. I realize that one can accomplish this currently by creating an anchor at the heading, however being able to link to headings would mean that there would be a bunch of pre-existing anchors already in place at the logical places one might want to link to.

I thought of this feature today when I posted a support question and wanted to reference a particular section in the TWiki documentation. I didn't want to edit the documentation to insert my own an anchor, but would have liked to included a link to the section I was addressing.

-- LynnwoodBrown - 06 Apr 2002


IMPORTANT (Notes duplicated from below)

Please note that the heading anchors as described by RandyKramer in the next note are not documented and should not be used because they will change most likely once TocFailsForIdenticalHeadingNames, NumberedHeadersAndLists and AutomaticallyNumberedHeadings are implemented.

-- PeterThoeny - 11 Apr 2002

I may start a list (on WikiLearn) of Wikilearn.UndocumentedTWikiFeaturesThatShouldNotBeUsed -- I already got bit by depending on an undocumented feature of <H3>.

-- RandyKramer - 11 Apr 2002


That feature already exists. AFAIK, all headers automatically create an anchor which you can link to, for example, like this #A_Test_Heading.

Note that spaces and many punctuation marks are replaced by underlines, and only the first 32 characters (counting the underlines) of the heading are included in the anchor.

Here is a link to a heading with some punctuation: #It_s_A_Test_Heading_With_Punctuation. Note: When I constructed this manually, it didn't work, so I saved the page, copied the link from the TOC, and then modified it by deleting the http stuff and adding the double square brackets.

While I'm testing, does this link work: #Here_s_Lot_s_of_Punctuation_

No -- I'm not sure why not in this case -- there is a problem if the last character is a dash -- see ProblemWithAnchorLinks

This is looking more and more like a bug -- and not the same one RichardDonkin talks about on ProblemWithAnchorLinks -- guess I'll mark this page as a bug report, although perhaps I'm expecting a little too much in this case.

It's A Test Heading With Punctuation

A Test Heading

A Trick

Here's a trick I use if I have trouble determining what the anchor looks like (or manually creating the link):

  • Include a Table of Contents on the page by using the %TOC% tag
  • Include your headings
  • Preview and save the page
  • Now "hover" your mouse over the entries in the table of contents to see how the anchor was constructed.

Contents

Here's "Lot's" of?! Punctuation&#$@+-=

-- RandyKramer - 07 Apr 2002

Please note that the heading anchors are not documented and should not be used because they will change most likely once TocFailsForIdenticalHeadingNames, NumberedHeadersAndLists and AutomaticallyNumberedHeadings are implemented.

-- PeterThoeny - 11 Apr 2002

Oops, sorry! I guess I knew that but forgot that. Or at least I knew of one undocumented feature that I should not use -- don't remember for sure if it was this or something else. I think I should maintain a list of undocumented features that should not be used so I don't use them. wink (I guess the <H3> trick to avoid including a header in a TOC was another.)

-- RandyKramer - 11 Apr 2002

eek! I'm glad that Peter noted that this feature is "not quite ready for prime time" as I was ready to start using it all over the place! I may have already used it in a couple of places and will try to go back and edit them out. -- LynnwoodBrown - 11 Apr 2002

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2002-04-11 - LynnwoodBrown
 
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.