TypoScript in TYPO3 Phoenix
We have passed the first half of our first official TYPO3 Phoenix sprint and the sprint goal - to render a simple website - becomes more real every day. One part I've been working on quite intensively during the last days is the TypoScript rendering. To give you some impression of what you can expect from the next generation of TypoScript I'd like to start some loose series of blog posts about it.
Before I get down to the nitty-gritty, let me loose some words about the design goals of TypoScript II. And let me warn you: This might sound like a advertising brochure because I'm so consumed by this topic at the moment. So, the most important design goals I can remember right now were:
- Clear Purpose
- Consistency
- Object-Oriented
- Extensible
The clear purpose is supposed to help especially newbies to classify TypoScript in the world of markup languages they might know already.
TypoScript II is an object-oriented view configuration syntax
This means that we use TypoScript for selecting and processing the content we'd like to display on our website or in some other format. TypoScript won't be used for settings or pure configuration not related to the view - no more "Page TSconfig". This kind of usage caused a lot of confusion in the past and will be replaced by a combination of YAML and user interface controlled settings.
Consistency is what I've personally been longing for for years. Why does this property support stdWrap and the other doesn't? Why are there two properties "height" and "width" while another object uses "dim" (dimensions)? Is there life beyond option split?
We solved this by making TypoScript truly object-oriented. Each TypoScript object is implemented by a real PHP class which makes it possible to inherit certain common aspects from other objects. The probably nicest feature in that regard is the processors mechanism (I'l cover them in detail in a later post). Processors are basically stdWrap on steroids - they can be chained, put into a certain order, used multiple times on the same property and - most importantly - exist for any TypoScript Object property. There's no need for extension authors to support them explicitly, they are just there.
Object-orientendness also means that TypoScript goes pretty well with other PHP objects, such as Domain Models. We adhere to the clean approach we've taken for FLOW3 so you're able to display any PHP object by means of TypoScript.
Your favorite TypoScript object is not in the official TYPO3 distribution? No problem, because you can very easily create your own. And even better: you can override behavior of existing TypoScript objects, including the "built-in" objects provided by TYPO3, if you need to. Because TypoScript supports namespaces, you can even switch from one Page object implementation to another by just switching the namespace. And because each TypoScript object is based on a Fluid template you have full control over the HTML output if you want to.
Okay, before I end this working day now, here's one detail you might like if you're a fan of systems like Subversion or Git (and if you're not, you're not really a developer, are you?): TypoScript configuration is file-based by default - there's even no need to anchor it or reference to it from pages within your page tree. As long as the directory structure match that of the page tree, TS templates are mounted into the right place automatically. And because of that you can put your whole website, including all of its assets, into a FLOW3 package. But that's another story for somewhere along the way ...
What do you miss most with the current TypoScript syntax? And what's your favorite feature?
Comments
Leave a reply
Robert is TYPO3 5.0 and FLOW3 founding dev, espresso lover, hopeless optimist and proud father.
Recent Posts
- TYPO3 Phoenix, Aloha and the AGPL license
- Session Handling and Object Serialization
- Paper Selection Process for T3CON10
- MacBook Pro in den USA kaufen?
- TypoScript in TYPO3 Phoenix
http://www.goodboots4u.com
http://www.mvpjordans.com
http://www.goodprice4u.com
http://www.inkicks.com
http://www.favorite4u.com
http://www.fullugg.com
http://www.shoesmillion.com
http://www.soleinstyle.com
http://www.huntedhardy.com
http://www.fulljersey.com
"There's no need for extension authors to support them explicitly, they are just there."
That alone makes me happy enough :)
Consistency, yeah baby!
Hey Robert, thanks for the great post!
I hope Sebastian has said about the "feel of TS" is true! TS1 was incredibly cute=)
This sounds very good. I'm looking forward to seeing it in practice.
What I would mention among the missing stuff currently is an understandable implementation of "if", plus I would include "elseif" and "else".
Oh yes! No configuration/settings any more with TS ... that sounds good, I think this was a really bad design decision in the past.
By the way, I think this is good news for designers as well: Consistency helps everyone, and a UI for (some) settings is great for non-developers.
Looking forward to more about TypoScript II, cause I'm more of a sceptic about the "feature" in general, but maybe it just needs to be done better ;)
@Steffen: I've already seen and played around with the new syntax, and it's really easy. Most things you learned from TS v1 is still applicable to v2, and it still "feels like TypoScript".
Greets,
Sebastian
What I miss currently most, is the fact that we care only about developers. What about designers (the one who love to design frontends and wanna bring it into TYPO3 with ease & style)? Why is TYPO3 Phoenix cool, easy and fun for them?
I completely agree that TypoScript II is great for web developers. But is there any fun part that I am missing for designers? Please tell me, that there is or will be a "TYPO3 Phoenix Designers Guide". Let's get the designers also "objected" and not rejected.
I am writing this from the perspective of being in a new developing country for TYPO3: Japan. Let us show, how much fun it will be for web designers to bring in their crazy stuff into TYPO3.
Thank you. ありがとうございます。
Wow. Objective typoscript. We had that already or? I still remember The presentation in Kitzbühel. "i ve Seen The Matrix".
I miss a negation :-)
X != Y ;-)
And of course "nested" conditions...
These are the things i miss the most :-D
bye Carsten
Keep in mind that the syntax should be understandable by normal users. if it will be too complicate they will stop with lot of frustration :)