3

I want to be able to reliably link from one Wiki article to any header in another Wiki article.

I posted this suggestion on the Plugin Forum (http://fogbugzplugins.uservoice.com/pages/20251-fogbugz-plugin-ideas/suggestions/439553-make-the-named-anchors-used-by-the-toc-plugin-perm?ref=title), but that might be looked at mostly by non-FogCreek folks for Plugin development ideas... the ToC was developed by Fogcreek I think, so I'm dup'ng it here.

It looks to me like the current Table of Contents Plugin creates numbered name attributes and adds them to anchors in headers that it wants to include in the ToC. I would love to see two changes in a future update:

1- only add the named anchor if one does not already exist, otherwise use the existing one.

2- don't delete the named anchor when the ToC is deleted.

I think that would result in persistant named anchors in any page that has or had a Table of Contents. You could then link to it from other pages and the link would work even if the headers in that page change, the ToC is deleted, or regenerated.

Fog Creek Case FC1837873

flag

1 Answer

1

This isn't really an answer so much as a bit of background on how the TOC plugin works and why we implemented it the way we did.

The anchors added by the TOC plugin are mostly an illusion. The actual wiki article (as stored in the database) is never modified to include the anchors. They are added dynamically by the TOC plugin when the article is being rendered. This was the simplest solution as it allowed the TOC plugin to avoid having to maintain anchors across edits, check for and avoid duplicate anchors, etc.

It was also the cleaner solution (depending on your perspective) since it left no remnants behind if the TOC WikiBlock was removed from an article later.

I'm going to create a case for this to evaluate how we want to evolve the TOC plugin with a note to respond here once we've gone over it.

link|flag
thanks. Knowing the way it's implemented, I would have not expected a link like this fogbugz.mydomain.com/default.asp?W437#toc_7 to take me to the desired header, but it's cool that is does. Anyway, my personal trade off between ToC remnants and simplicity is to keep the remnants, since I see them as useful. :) – PJM Jan 8 2010 at 20:00
Maybe a better solution is to create a unique anchor for every header. The TOC could use it, but you wouldn't need a TOC to link from anywhere to a section of any article. – PJM Feb 2 at 16:19

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.