Page 1 of 1

CreateLink alt/title fix

Posted: Tue Jul 29, 2008 5:50 am
by superwad
I noticed that the CreateLink() method improperly implements the alt/title text in the tag.  What was happening was the alt text passed through the CreateLink() function (and passed to cms_module_CreateLink()) was just taking the passed text and sticking it in at the end of the tag.  This doesn't work to get tooltips working, and it would probably fail standards compliance.

The fix:

In modform.inc.php, on line 464, change:

Code: Select all

$text .= ' ' . $addttext;
to

Code: Select all

$text .= " title=\"". $addttext ."\" alt=\"". $addttext ."\"";
I added the "title" parameter there to address other browsers which do not activate tooltips for an alt tag (FF2/3 for instance).

With that fix, links created through CreateLink() show their alt/title properties properly :)

Re: CreateLink alt/title fix

Posted: Tue Jul 29, 2008 9:14 am
by stopsatgreen
Perhaps you should raise this as a bug in the Forge: http://dev.cmsmadesimple.org