create new tag
, view all tags

Include text from at/after the #MyAnchor in the linkToolTipInfo generated summary.


The title/tooltip text (mouse-over popup) should relate to text at/after the anchor, not the top of page; this is especially useful if the anchor is a short 'footnote' or definition or subheading in a larger document.


The perl code to generate the title="$summary..." can be modified to include text after the anchor; instead of using text from the top of page. Like this HTML link

clearly, the view generator must confirm the anchor exists to create the link, so it knows the text at and after the anchor; just include that instead of the current top of page text.

I am not a TWiki/Perl expert or I would attach the patch; can someone at least point to the file to be modified?

-- JeffPeck - 14 Oct 2005

Impact and Available Solutions

Note: Patch is attached as Render-AnchorToolTipSummary.diff. The patch is against the version 02 Sep 2004 $Rev: 1742 $,


If necessary, user documentation of new features introduced by this proposal.


Example uses of features introduced by proposal.

If you have this patch installed, then hovering over the link above would show this text!

If not installed then each link just shows the top of topic summary.

Of course, you must



Include $theAnchor as argument to &linkToolTipInfo.

in &linkToolTipInfo(): if $theAnchor is supplied, then do the extra work read and search though theTopic text; find the #Anchor; supply the text after the #Anchor as the $summary to &TWiki::makeTopicSummary()

Note: the extra processing is only incurred if a #Anchor reference is being expanded, regular topic references are unchanged.

The attached patch is my first TWiki/Perl hacking, so it could undoubtedly be improved.


update: now I have found Render.pm, and I see that linkToolTipInfo($theWeb, $theTopic) must be supplied with $theAnchor as an additional argument; and then the replacement for $summary needs to somehow read down to the anchor to extract the relevant text.

Can someone contribute the code to find the #Anchor in theTopic data? a way to read the file and apply some regexp like "$theAnchor.{100}" or some such?

-- JeffPeck - 21 Oct 2005

Ok, Thanks for all your helpful hints. I have patched Render.pm to achieve the effect requested.

-- JeffPeck - 21 Oct 2005

Renamed topic as requested by JeffPeck. Usually CoolURIsDontChange, but this topic is young enough.

Bumping this to EdinburghRelease sice we have a code freeze for DakarRelease.

-- PeterThoeny - 03 Nov 2005

Having so much fun with this, I hacked it to tooltip-ify the links in a TOC. Also enable [\[#My_Heading]\] to tooltip-ify (add extra "_" for each funky character in the heading text :))

Great for FAQs.

-- JeffPeck - 04 Nov 2005

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatdiff Render-AnchorToolTipSummary.diff r1 manage 3.2 K 2005-10-21 - 02:15 JeffPeck  
Unknown file formatdiff Render-AnchorToolTipSummary2.diff r1 manage 3.3 K 2005-11-04 - 03:01 JeffPeck Amended to work with TOC links
Unknown file formatdiff TWiki-AnchorToolTipSummary2.diff r1 manage 1.4 K 2005-11-04 - 03:02 JeffPeck amendment to work with TOC links
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2005-11-04 - JeffPeck
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.