[TYPO3-dev] TypoScript: Getting Content into stdWrap.preUserFunc
Peter Klein
pmk at io.dk
Wed Sep 16 19:43:55 CEST 2009
Hi Sebastian
That's because your TS setup is wrong. If you want the "value" passed to the
userFunc, you need to place it inside the "isTrue" part.
Here's an example from TinyMCE RTE:
// Parsing of A tag if an anchor
20 = TEXT
20.current = 1
20.dataWrap = <a {parameters : allParams}>|</a>
20.if.isTrue.data = parameters : allParams
20.if.isTrue.postUserFunc = user_tinymce_rte->isNotAnchor
20.if.negate = 1
The Userfunc looks like this:
function isNotAnchor($content,$conf) {
return preg_match('/\w*href\s*=\s*"([^"]+)"\s*/i', $content) ? 1 : 0;
}
--
Peter Klein / Umloud Untd.
"Sebastian Gebhard" <sebastian.gebhard at googlemail.com> wrote in message
news:mailman.1.1253100940.21398.typo3-dev at lists.netfielders.de...
> Steffen Kamper schrieb:
>> Hi Steffen,
>>
>> it doesn't surprise me that in a "pre" the content is empty. Why don't
>> you use postUserFunc and remove content if no access?
>>
>> btw - description in tsRef lacks ...
>>
>> vg Steffen
> 10 = TEXT
> 10{
> field = title
> # Check if this cat or its subcats have items
> if{
> isTrue{
> postUserFunc = tx_myext_UserFuncs->myUserFunc
> postUserFunc.recursive = 1
> }
> value.field = uid
> }
> }
> Doesn't work either :/
> Neither TEXT.title nor if.value are passed to postUserFunc
More information about the TYPO3-dev
mailing list