[Typo3-german] typolink.userfunc mit alt= bzw. title=page_title : page_subtitle ?

Tobias Erlacher erl at maguma.com
Wed Sep 14 08:57:49 CEST 2005


Hallo Bernhard,


ich würde das alles mit ts machen. Folgendes beispiel habeich vor ein 
paar wochen aus der Mailingliste ausgegraben ich weiss leider nicht mehr 
wer das gemacht hat.


tt_content.text.20.parseFunc.tags.link >
tt_content.text.20.parseFunc.tags.link = COA
tt_content.text.20.parseFunc.tags.link {
10 = TEXT
# interne links
10.value = [I]
10.if {
value = 0
isGreaterThan.data = parameters:allParams
isGreaterThan.intval = 1
}

20 = TEXT
# externe links
20.value = [E]
20.if {
value = 0
isGreaterThan.data = parameters:allParams
isGreaterThan.intval = 1
negate = 1
}

30 = TEXT
30.current = 1
stdWrap.typolink.parameter.data = parameters : allParams
stdWrap.typolink.extTarget = {$styles.content.links.extTarget}
stdWrap.typolink.target = {$styles.content.links.target}
stdWrap.typolink.wrap = {$styles.content.links.wrap}
stdWrap.parseFunc.constants =1
}

Tobias Erlacher

www.typo3wizard.com


Bernhard Welzel wrote:
> ich habe eine Typolink Userfunc um bei Links interne/externe Links zu 
> unterscheiden, und würde nun gerne bei internen Links auch <a title= 
> $page_title setzen.
> 
> Leider habe ich in den Newsgroups (typo3.german & typo3.english) sowie 
> bei typo3.org / typo3.net bislang keinen Lösungsansatz gefunden.
> 
> - Bernhard Welzel
> 
> 
> Setup.
> 
> includeLibs.user_typolink = fileadmin/scripts/usertypolink.php
> tt_content.text.20.parseFunc {
>   tags.link.typolink.userFunc = user_typolink_class->main
> }
> 
> sowie:
> 
> <?php
> class user_typolink_class {
>    var $cObj;    // reference to the calling object.
>    function main($content,$conf)    {
>       global $TSFE;
>       if ($content["TYPE"] == "url"){
>          $linktarget="a_extern";
>          $linktitle='Link: '.$content["url"];
>          }
>         else {
>          $linktarget="a_intern";
> 
>       }
>       return '<A HREF="'.$content["url"].'" class="'.$linktarget.'" 
> title="'.$linktitle.'"'.$content["targetParams"].$content["aTagParams"].' 
> title='.$verflixtwoherbekommeichdas.'" >';
>     }
> }
> ?>



More information about the TYPO3-german mailing list