[Typo3] Passing the current value to a user function in typoscript

Farhdine Boutzakhti funkycms at axidea.fr
Tue Oct 18 12:44:18 CEST 2005


Robert John de Stigter wrote:
> Hi,
>  
> In a templavoila datastructure I can add typoscript code to an element.
> Like this:
>  
> <TypoScript>
> 10 = TEXT
> 10.current = 1
> 10.case = upper
> </TypoScript>
>  
> This will uppercase the value put in the form. But how can I pass the
> current value to a custom function?
> This doesn't seem to work.
> <TypoScript>
> 10 = USER
> 10.current = 1
> 10.userFunc = myclass->myfunction
> </TypoScript>

I think you can try this;
in TS:
<TypoScript>
10 = TEXT
10 {
   postUserFunc = myclass->myfunction
   postUserFunc.field = 1
}
</TypoScript>

and catch the field in your function:
function	myfunction($content, $conf) {
	// this will return '1'
	return ($conf['field']);
}




More information about the TYPO3-english mailing list