[pmwiki-users] 'title' attribute of an HTML link
Jean DEMARTINI
jean.d.demartini at wanadoo.fr
Wed Jan 11 10:05:57 CST 2006
Patrick,
I aggree with the fact that to introduce an attribute to define a title
attribute is not a very elegant method and I'm ready to abandonned it.
I'have tried the method you propose. It functions quite properly with
external links. Then OK.
But, I encountered a problem with internal links. Naively, I'have tried
the following code:
$LinkPageSelfFmt = "<a class='selflink' href='\$LinkUrl'
title='\$LinkAlt'>\$LinkText</a>";
$LinkPageExistsFmt = "<a class='wikilink' href='\$LinkUrl'
title='\$LinkAlt'>\$LinkText</a>";
It does not function because $LinkAlt is not replaced by its value and
we see the string '\$LinkAlt' in the bubble. Things are not so simple.
Sight.
Regards,
Jean
Patrick R. Michaud a écrit :
>On Wed, Jan 11, 2006 at 11:46:00AM +0100, Jean Demartini wrote:
>
>
>>As all know, the 'title' attribute of an HTML link gives a bubble when
>>the mouse is moved over the link. How to define the 'title' attribute of
>>the HTML link associated to a PmWiki link ?
>>
>>A way similar to the way used to define the 'target' attribute could be
>>great !
>>
>>
>
>PmWiki already reserves the use of double-quotes to be able to
>set the title= attribute for links, as in
>
> http://www.pmichaud.com/toast"Strawberry Pop-Tart Blow Torches"
>
>This is already done for images, but the feature has never really
>been fleshed out for links. Also, somehow using WikiStyles for
>title= attributes has never felt quite right to me.
>
>One can currently get a close approximation by doing
>
> $UrlLinkFmt =
> "<a class='urllink' href='\$LinkUrl' rel='nofollow'
> title='\$LinkAlt'>\$LinkText</a>";
>
>and then doing
>
> [[http://www.pmichaud.com/toast("Strawberry Pop-Tart Blow Torches")]]
>
>See http://www.pmwiki.org/wiki/Test/LinkTitle. The double-brackets
>and parens are necessary here to prevent the quoted text from
>being displayed as part of the link text. Ideally I suppose that
>we should fix bare links like
>
> http://www.pmichaud.com/toast"Pop Tarts"
>
>to automatically suppress the display of the quoted title attribute,
>so that we get
>
> <a class='urllink' href='http://www.pmichaud.com/toast'
> title='Pop Tarts'>http://www.pmichaud.com/toast</a>
>
>and not
>
> <a class='urllink' href='http://www.pmichaud.com/toast'
> title='Pop Tarts'>http://www.pmichaud.com/toast"Pop Tarts"</a>
>
>Comments welcome.
>
>Pm
>
>
More information about the pmwiki-users
mailing list