blog.Resource

Archive:

News-Feeds:


RSS 2.0
RSS 0.91
RDF
ATOM 0.3
January 18, 2008

TypoScript: beauty or beast?

Category: François Suter

By: François

At first sight TypoScript often appears as an indomitable beast. At second sight this feeling tends to persists and it takes some more efforts to feel at ease with it. But isn't it a beauty after all?

A grinning devil on the top of a roof at Himeji Castle, Japan.

TypoScript is the subject of many discussions. Countless TYPO3 beginners (yours truly included) have sworn at its apparent weirdness and complexity. Many others wondered about its odd syntax. And why not use XML? And why not do the whole thing with PHP? On the other hand TypoScript was unanimously voted as the feature to preserve first and foremost in TYPO3 version 5.0, albeit with a more consistent syntax.

There are several issues with TypoScript when you first sit down and try to wrestle it. To start with you don't know about the existence of the documents called TypoScript Syntax and TypoScript by Example. This is an obvious shame since they do get you very neatly started with the whole thing. Then you have to start digging into the TypoScript reference, whose structure is not obvious at first. It is also apparently very much oriented towards programmers, a limitation that didn't strike me being a programmer myself, but which has been raised in the mailing lists. Furthermore – TSRef notwithstanding – some of the objects have a heap of properties sometimes inconsistent. Then you start thinking in terms of programming language, because TypoScript resembles one with its curly braces, but it's not. Things continue down the slope as you have to tackle your first "optionSplit" and go definitely down the drain as you attempt your first "if".

If you manage to imitate a well-known fiery bird and raise out of your own ashes, you generally reach some kind of illumination where it all starts making sense (except for inconsistencies which can sadly not be cast away that simply). The TSRef finally reveals its logic and you are able to jump from one reference to another and start using all the power of TypoScript. But what is that power exactly? For me it is the possibility to fully customise the output of TYPO3 without touching its code. Indeed all this could be achieved using plain PHP, but the advantage of TypoScript is to provide a layer between TYPO3's PHP code and your site. As long as backward compatibility (also known as "holy cow") is maintained, no matter what changes happen to the core of TYPO3, your TypoScript will be still be valid and hence your site will not be broken by updating to a newer version of the software. The reverse is also true: this layer makes it possible to fiddle with the set up of your web site while confident that nothing you do in TypoScript can break TYPO3 itself.

So is TypoScript a beauty or a beast? For my part I think it is a beautiful beast.


comments

comment #1
Gravatar: S. Teuber S. Teuber January 19, 2008 13:24
A beauty, nothing else. Once you figured out how to configure not only the core, but most extensions' and especially your own extension settings with TypoScript, you wouldn't wanna miss it anymore. It's a beautiful "write the PHP code once, then just set your parameters with TypoScript"-feature.

Mapping TypoScript content-object configurations to database columns and putting the result in a marker array is by far the most flexible, least php coding effort way of getting your plugin output. Talk about rapid development here.

Long story short: I love it.

comment #2
Gravatar: Ingo Ingo January 19, 2008 15:47
Oh lovely optionSplit =)

comment #3
Gravatar: Peter Foerger Peter Foerger January 21, 2008 09:45
Beauty.
But our little cutie from the 90's has become a mellow lady by now.
Still she is doing a perfect job on taking care of any kind of content parsing as well as a decent education of T3 operators, but I'm wondering what next generation TYPO3 users will be voting for in upcoming beauty contests.
Will plain configuration files attract born into YouTube kids? Well, TS's backbone is straight, at least most parts are, but I guess we will need some fresh skin to be well prepared in the long run.

comment #4
Gravatar: Charles Coleman Charles Coleman January 30, 2008 03:13
Yes... TS is a beauty and I love the abstraction from the core. But undoubtedly there are some beastly attributes as well. I completely agree with Peter that to continue on the upward trend in the T3 community requires some way to ease the learning curve. There are those who pride themselves on being a self-made sensei of TS and feel that it's the right of passage for every newcomer to pass through the same gauntlet. I haven't the foggiest idea how to make it more intuitive, but the documentation could use some serious overhauling in the organization/usability department. For a start, maybe we could combine the multiple locations of TS reference pages in one pulsating searchable and user commentable TS dictionary (like php.net for example). I find myself routinely searching for the correct document and then going through it page by page use my browser to search for the TS in question. I hope there's a better way! Do my musings fall on deaf ears or does someone in a position to do something about it agree?

Sorry, comments are closed for this post.