[TYPO3-dev] TypoScript: Getting Content into stdWrap.preUserFunc

Sebastian Gebhard sebastian.gebhard at googlemail.com
Wed Sep 16 11:16:43 CEST 2009


Hi *,

i'm using stdWrap.preUserFunc for the first time and wonder how to get 
content in it.

Inside a CONTENT.renderObj[COA_INT] i want to check if an item should be 
displayed or not with a user function. I have the following code:

10 = TEXT
10{
   field = title
   # Check if this item should be displayed
   if{
     isTrue{
       preUserFunc = tx_myext_UserFuncs->myUserFunc
       preUserFunc.recursive = 1
     }
     value.field = uid
   }
}

In my PHP method:
public function itemsInCategory($content, $conf){
	print_r($conf);
	echo $content.'<br>';
	return 1;
}

$conf gets printed out (recursive=>1), but $content does not contain 
anything. So the if.value is not passed.

Ok, then I thought maybe the content of TEXT is passed:

10 = TEXT
10{
   field = uid
   # Check if this item should be displayed
   if{
     isTrue{
       preUserFunc = tx_myext_UserFuncs->myUserFunc
       preUserFunc.recursive = 1
     }
   }
   override.field = title
}

But still $content is empty.
I wrote down the stdWrap properties in the same order they get executed 
to improve readability.

Any ideas how i can get die field = uid into my userfunc?




More information about the TYPO3-dev mailing list