


First create a file named "userFunc.inc" in your fileadmin folder, then fill the file with this content:
<? class user_userFunc{ - ERROR: Line 2: Object Name String, "class" was not preceded by any operator, =<>({;Line 15: Object Name String, "class" was not preceded by any operator, =<>({ function addAttributes($content,$conf) { - ERROR: Line 3: Object Name String, "function" was not preceded by any operator, =<>({;Line 16: Object Name String, "function" was not preceded by any operator, =<>({ $aTagParams = $this->cObj->stdWrap($conf['aTagParams'], $conf['aTagParams.']); - ERROR: Line 4: Object Name String, "$aTagParams" contains invalid character "$". Must be alphanumeric or one of: "_-.";Line 17: Object Name String, "$aTagParams" contains invalid character "$". Must be alphanumeric or one of: "_-." $content["aTagParams"].= ' '.$aTagParams; - ERROR: Line 5: Object Name String, "$content["aTagParams"]." contains invalid character "$". Must be alphanumeric or one of: "_-.";Line 18: Object Name String, "$content["aTagParams"]." contains invalid character "$". Must be alphanumeric or one of: "_-." $content['TAG'] = '<A HREF="'.$content["url"].'"'.$content["targetParams"].$content["aTagParams"].'>'; - ERROR: Line 6: Object Name String, "$content['TAG']" contains invalid character "$". Must be alphanumeric or one of: "_-.";Line 19: Object Name String, "$content['TAG']" contains invalid character "$". Must be alphanumeric or one of: "_-." return $content['TAG']; - ERROR: Line 7: Object Name String, "return" was not preceded by any operator, =<>({;Line 20: Object Name String, "return" was not preceded by any operator, =<>({ } - ERROR: Line 8: An end brace is in excess.;Line 21: An end brace is in excess. } - ERROR: Line 9: An end brace is in excess.;Line 22: An end brace is in excess. ?> - ERROR: Line 10: Object Name String, "?" contains invalid character "?". Must be alphanumeric or one of: "_-.";Line 23: Object Name String, "?" contains invalid character "?". Must be alphanumeric or one of: "_-."
Then at the top of your typoscript SETUP, you insert a line like this:
includeLibs.userFunc= fileadmin/userFunc.inc
Now 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"
This snippet was submitted by Peter Klein


Comments (1)