[TYPO3-dev] Pimp My TypoScrip

JoH asenau info at cybercraft.de
Fri Jul 16 11:00:52 CEST 2010


Lina Wolf wrote:
> I wanted to ask about the outcome of "Pimp My TypoScript" at the
> t3dd10. 
> 
> How exactly is chained TypoScript going to look like? I had a look at
> this example:
> http://forge.typo3.org/projects/extension-tspimp/wiki/Examples but it
> kind of looks like normal TS to me or did I over see something? 

In a way it does look like "normal" TS, but when you take a look at the examples, you will notice that there are properties, that will be using stdWrap properties, which can be again using stdWrap properties and so on. So it's not completely the same as "chained" jQuery functions but it works similarly.

Example for prioriCalc:

Default would be prioriCalc=1 or prioriCalc=intval without any other options.
With "chained" TypoScript you will be able to do something like that as well:

prioriCalc.field = do_calculation

So the editor will be able to set 1 or intval or nothing from within a backend form

Another example for dataWrap:

field = blah
dataWrap = {field:whatever} | blah something
dataWrap.fieldRequired = whatever
wrap = <div></div>

This way you can use a required field not just for the parent element of dataWrap, but directly for the function, so that dataWrap will be only executed, when the field has some value, while the rest of the stuff will still be applied.

This will give a much more flexible and fine grained control over TypoScript properties, while still keeping backwards compatibility.
With one exception though: TypoScript code, which contains these chains already by mistake, will suddenly start working.
 
> Furthermore I read the plan was to implement stdWrap where its still
> missing. Where has this been implemented?

It's not yet implemented but we managed to find most of the places where it is missing.
And we found just a few places, where functions are used that have the same name as original stdWrap functions.
i.e. there is stdWrap.crop which is cropping texts and on the other hand there is CROP.crop which is cropping GIFBUILDER images.
But since the focus is quite clear in any case that we found, we can safely use workarounds there.
 
> Did you also implement any missing stdWrap functions?

Same thing here - we found a lot of missing functions (that still have to be written to the wiki) - and some of them have been already written during the workshop.
Implementation will follow after the pending patch to refactor tslib has been committed to trunk.
This patch will already split up the content elements into subclasses to make cObj smaller and improve overall performance.
Additionally this has the nice side effect, that you can easily implement your own TypoScript element MY_ELEMENT just by extending the base class.
 
> Do I understand correctly that the code is going to be part of TYPO3
> 4.5? 

The refactored tslib stuff is already pending in core list, stdWrap and others will follow hopefully before feature freeze.
We (steffen Kamper and me) have proposed a talk for T3CON, where we will be presenting the upcoming features of TypoScript in 4.5

Hope this clarifies it a bit

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com


More information about the TYPO3-dev mailing list