[pmwiki-users] Mouse over show summary

Petko Yotov 5ko at 5ko.fr
Sun Jul 24 06:36:37 CDT 2011


On Friday 22 July 2011 09:26:35, Simon wrote :
> I'd like to have a mouse over of an internal wiki link show the page
> summary.
> 
> Can anyone please point me in the right direction?

The link title attribute can only contain plain text. 

If what you call the "page summary" is a PageTextVariable, you cannot be sure 
that someone didn't add styles, links, tables or other content that is not 
allowed in link title attributes.

> Looking at
> http://www.pmwiki.org/wiki/Cookbook/LinkPageExistsFmtTooltip
> 
> adding
> $LinkPageExistsFmt = "<a class='wikilink' title='{\$Summary}'
> href='\$LinkUrl'>\$LinkText</a>";
> 
> would appear to be all that is needed.

This code will place the plain text of the PageTextVariable in the tooltip 
title of the link:

  $FmtPV['$Summary'] = 'Keep(str_replace(array(\'"\',"\'"),
    array(\'"\',\''\'),PageVar($pn, "\$:Summary")))';
  $LinkPageExistsFmt = "<a class='wikilink' title='{\$Summary}'
   href='\$LinkUrl'>\$LinkText</a>";

Petko



More information about the pmwiki-users mailing list