CreateLink alt/title fix

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
superwad
Forum Members
Forum Members
Posts: 26
Joined: Sun Jun 29, 2008 2:41 am

CreateLink alt/title fix

Post 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 :)
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: CreateLink alt/title fix

Post by stopsatgreen »

Perhaps you should raise this as a bug in the Forge: http://dev.cmsmadesimple.org
Post Reply

Return to “Developers Discussion”