[TYPO3-mvc] TypoScript manipulation per object property

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Jul 22 10:57:35 CEST 2010


Hey Thomas,

>> I'd like to provide the possibility to define custom
>> TypoScript for every property of every object available,
>> which would be used to manipulate the final output of
>> the property in the template.
...
> 1) I have to explicitly set "current = 1":
...
> 2) Adding a lot of those viewhelper will end in unreadable templates:
...
> (That's only for one property 'street' in the template.)
>
> So I'm wondering if there would be a better solution which would
> just apply the typoscript configuration and use the returned value
> in the template.
>
> Is it needed to "hook" into Fluid there somewhere?

I don't think so, because FLUID itself is using 
Tx_Extbase_Reflection_ObjectAccess to resolve the values. Also using 
hooks wouldn't be compatible with v5 AFAIK.

> I suppose it's cleaner to do this "manipulation" somewhere AFTER the
> value was returned from the property getters, because I think it's
> cleaner AND correct to return the full "raw" value from the getter.
> (Also because I want to make this typoscript manipulation ONLY for the
> template output.)

yes - don't do it in the getters - it's clearly part of the view and not 
the model.

> Any ideas?

yep - I think using something like the "alias" viewHelper might help 
here - so a viewHelper where you pass a array/object to and it will be 
processed and reassigned to the view again. Your viewHelper could then 
do two things:
a) preprocess all values and assign them as array back to the view 
(easiest, yet worst solution as you produce much overhead with 
preprocessing unused properties)
b) use proxy classes which will fetch and process the return values on 
demand (the way I'd go)


-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list