[TYPO3] typolink.ATagParams

Peter Klein peter at umloud.dk
Fri Mar 3 16:01:35 CET 2006


"J. Ryan Kelley" <ryan.kelley at trinitytransport.com> wrote in message 
news:mailman.6744.1141393050.3122.typo3-english at lists.netfielders.de...

> Peter.....I tried to follow along with your post that you sent in the link 
> to me previously, but I think that the code was over my head (I'm

Hi Ryan. Here's a complete guide.. :)

First create a file named "userFunc.inc" in your fileadmin folder, then fill 
the file with this content:

-- cut --
<?
class user_userFunc{
   function addAttributes($content,$conf) {
    $aTagParams = $this->cObj->stdWrap($conf['aTagParams'], 
$conf['aTagParams.']);
    $content["aTagParams"].= ' '.$aTagParams;
    $content['TAG'] = '<A 
HREF="'.$content["url"].'"'.$content["targetParams"].$content["aTagParams"].'>';
    return $content['TAG'];
   }
}
?>
-- cut --
Then at the top of your typoscript SETUP, you insert a line like 
this:includeLibs.userFunc= fileadmin/userFunc.incNow you are ready to use 
the function in your "typolink" setups, where you add it to your existing 
typolink code like this:    typolink.userFunc = user_userFunc->addAttributes
    typolink.userFunc.aTagParams.dataWrap = alt="{field:title}" 
title="{field:title}"

The extra "aTagParams" are then added to the normal "aTagParams"---Peter 
Klein / Umloud untd 





More information about the TYPO3-english mailing list