[TYPO3-dev] problem with XCLASS: how to override a function in class.t3lib_browsetree.php ?

Daniel Pötzinger operation-lan at gmx.de
Mon Jan 14 09:40:49 CET 2008


stefano cecere schrieb:
> please i'm struggling for days with this (it should be simple) thing:
> 
> i'd like to override the function getTitleStr in 
> class.t3lib_browsetree.php, so to customize the page tree title 
> rendering with
> a custom function.
> 
> 
> but i can't make the right XCLASS! i could not find much docs about it.
> 
> right now i have (in my ext_localconf.php ) this line:
> 
> $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php'] 
> = t3lib_extMgm::extPath($_EXTKEY).'class.ux_t3lib_browseTree.php';
> 
> 
> within class.ux_localPageTree.php i set:
> 
> class ux_t3lib_browseTree extends t3lib_browseTree {
>     
>     function getTitleStr($row, $titleLen = 30) {
>          /// my func
>     }
> }
> 
> 
> shouldn't it be enough?
> it seems not, since it doesn't work enyway.
> 
>  :(

Is that the reason:
http://typo3.org/fileadmin/typo3api-4.0.0/d1/d1f/classt3lib__browseTree.html

I think you try to modify that function for one of the child-classes?
the t3lib_browsetree is used by many classes as baseclass - therefore 
your XCLASS has no effect.  (because "localPageTree extends 
t3lib_browseTree")

You can instead XCLASS one of the childs.

Greetings





More information about the TYPO3-dev mailing list