[TYPO3-english] tt_address and userFunc to generate realURL?

Martin Mädler martin.maedler at rwth-aachen.de
Wed Mar 16 11:22:25 CET 2011


Hi, so I hacked a solution together by editing 
pi1class.tx_ttaddress_pi1.php on line 323. In case someone runs into a 
similar problem, this is what I got:

// HACK: UID is our link now ;-)
//$markerArray['###UID###']          = $address['uid'];
$charset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? 
$GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : 
$GLOBALS['TSFE']->defaultCharSet;
$group = $GLOBALS['TSFE']->csConvObj->conv_case($charset, 
$address['groups'][0]['title'], 'toLower');
$name = $GLOBALS['TSFE']->csConvObj->conv_case($charset, 
$address['first_name'] . ' ' . $address['last_name'], 'toLower');
$group = strtr($group, ' -+_', '----');
$name = strtr($name, ' -+_', '----');
$group = $GLOBALS['TSFE']->csConvObj->specCharsToASCII($charset, $group);
$name = $GLOBALS['TSFE']->csConvObj->specCharsToASCII($charset, $name);
$addressLink = 'team/' . $group . '/' . $name . '/';
$markerArray['###UID###'] = '<a href="' . $addressLink . '">' . 
$address['first_name'] . ' ' . $address['last_name'] . '</a>';

If you're using a multi-language site, you probably want to adjust this 
code. I initially wanted to do it with a userfunc via TS...

Cheers
Martin
> *Example*
> Input: arg1: "Thomas", arg2: "Müller"
> Output: <a href="team/thomas-mueller/">Thomas Müller</a>
>
> But I have no idea how I can tell TYPO3 to use my custom function to 
> generate that link. Is that even possible? Is this a bad idea?
>



More information about the TYPO3-english mailing list