[TYPO3-core] RFC: #9336 Enable ascii for parsefunc-short replacement

Steffen Kamper info at sk-typo3.de
Fri Sep 12 12:42:15 CEST 2008


Oliver Hader schrieb:
> Oliver Hader schrieb:
>> Example:
>> 10 = TEXT
>> 10 {
>>   field = bodytext
>>   stdWrap.strReplace {
>>     search.char = 32
>>     replace = %20
>>   }
>>   parseFunc {
>>     ...
>>   }
>> }
>>
>> 20 = TEXT
>> 20 {
>>   field = bodytext
>>   stdWrap.pregReplace {
>>     search = (cat|dog|tiger)
>>     replace = animal
>>     modifier = 1
>>   }
>>   parseFunc {
>>     ...
>>   }
>> }
> 
> Or as addition a combined way to perform more than one replacement:
> 
> 10 = TEXT
> 10 {
>   field = bodytext
>   stdWrap.replacement {
>     10 {
>       search.char = 32
>       replace = %20
>     }
>     20 {
>       search = oldValue
>       replace = newValue
>     }
>     30 {
>       search = (cat|dog|tiger)
>       replace = animal
>       // regExp could be "1" for "yes, use preg_replace" or a modifier
>       regExp = i
>     }
>   }
>   parseFunc {
>     ...
>   }
> }
> 
> The indexes 10, 20, 30 are just for setting an order on the execution of 
> the replacement. Each subkey "search", "replace" and "regExp" has again 
> stdWrap functionality.
> 
> olly

Hi,

i really like that suggestion. That would also give a good possibility 
to replace words in content eg name of Company and replace it with an 
image, so stdWrap for replace should be given too like
replace.cObject = IMAGE
This would be more easy than using the hook for many users.

vg Steffen


More information about the TYPO3-team-core mailing list