Continuing my article series (find part 1 here) on TemplaVoilà replacements I take a look at two TYPO3 extensions, which have the potentials to play big roles in the upcoming years when it comes to templating in TYPO3: the already very well-known Grid Elements extension and the not (yet) so famous Theme Packages project.
The misunderstood: Grid Elements
When asked, what to use instead of TemplaVoilà nowadays, many TYPO3 developers will give you one answer: Grid Elements. And indeed did the Grid Elements project create quite some buzz in 2012/2013, when development of version 2.0 of the extension, which brought compatibility with the 6.x branch of TYPO3 CMS, was successfully crowdfunded as the first TYPO3 extension ever. This and the fact, that the rise of Grid Elements coincided with the dying of TemplaVoilà, surely have contributed to the perception of it being a full-fledged successor to TemplaVoilà.
But this is only partly the case: Grid Elements was never intended to replace TemplaVoilà as a whole – and will never do! In fact it only takes care of one of the key features of TV – but does this very well: Providing reusable container elements, e. g. for flexible multicolumn layouts.
I think it’s important to clearly point this out. Many developers misinterpret the intention of Grid Elements, and therefore use it, when they’d better use something else. (See more on this below.)
Why reinventing the wheel?
So what is Grid Elements all about then? The basic idea is as simple as ingenious: It takes the great concept of “Backend Layouts”, introduced in TYPO3 4.5 to the core, and transfers it from pages to content elements.
By doing so it allows you to easily create flexible, reusable and nestable container elements for your content in a way you may already be used to: The backend grid wizard for creating new “CE backend layouts” (how the container elements are officially called) looks and works like the Backend Layouts wizard, and the TypoScript code for rendering your own Grid Elements-based containers in the frontend has many things in common with that of the Backend Layouts (e. g. in both cases you use the uid of the backend elements in your TypoScript code to decide on how to render them).
The affiliation to Backend Layouts is clearly one big advantage of Grid Elements: When you’ve already worked with Backend Layouts, working with Grid Elements is almost seamless. You don’t have to get used to yet another templating concept. And by combining Backend Layouts (which I will cover in another post) and Grid Elements you have indeed two thirds of the key features of TemplaVoilà covered: page templating and container elements.
Flexible content elements – yes or no?
When looking at the manual of Grid Elements, you will notice even one more thing: In theory you can also create FCE-like content elements by utilizing Flexforms. This surely contributed to people thinking of Grid Elements as a full-fledged TV replacement. But, and this is a big BUT, the manual clearly states, that using Flexform fields (which are actually there for configurational purposes only) for building flexible content elements is not recommended and should be avoided, as it would mean to bypass one of the basic architectural principles of Gridelements: using normalized database relations between containers and elements instead of storing relations in XML structures (like also TemplaVoilà did it and what has always been one of its biggest failures). So you better don’t use Grid Elements that way…
Also good to know
Until recently Grid Elements suffered from some weird behaviour, when using it on multi-language sites or when working with workspaces (see e. g. here, here and here). Though I had Grid Elements up and running on multi-language sites, those problems (actually rooted in TYPO3 core bugs and not in Grid Elements itself) caused some headaches in the past and would have led to the recommendation to not use Grid Elements in multi-language projects. But fortunately those problems seem to be fixed by now (I was not yet able to check it out, but reportedly everything’s cool now).
Another thing you should be aware of, is, that Grid Elements changes the colPos field of the tt_content table from unsigned int(3) to smallint(6), as it needs negative values in the colPos field to work properly. So make sure this doesn’t get reverted when upgrading your TYPO3 installation! (I don’t like that approach very much, as it alters TYPO3 core functionality in a non-update-safe way, but I assume the developers of Grid Elements had good reasons for it.)
Where the heck is the documentation?
One thing that still puzzles me a little bit about Grid Elements: despite its popularity you don’t find that much information about it online. And especially beginners may struggle over one thing: the “Extension Manual” link on the TER page shows a 404 error page – already for weeks if not for months. First I thought, that a manual just does not exist (anymore). The more I was startled, when I found a very well written and exhaustive manual in the Documentation folder of the extension after downloading and installing it. So don’t miss that!
Besides of that you should follow the ongoing development on Forge and take a look on the Blog of the startnext project page, where the creators of Grid Elements keep you updated on further plans (Grid Elements 2.1 and 3.0, the latter supporting TYPO3 6.2 LTS are already under way). A step by step introduction can be found here (German only), and some example implementations directly from the creators here. And finally: if you are planning to migrate an existing website from TemplaVoilà to Backend Layouts and Grid Elements you definitely should take a look at sf_tv2fluidge and the corresponding blog post, showing you how this extension can help you with this task.
So all in all and besides some (minor) flaws Grid Elements is a great piece of software and will pretty sure win in popularity even more in the future, especially because it is actively maintained and constantly improved. And I think I’m not the only one, who would like to see it (or some similar functionality) incorporated into the TYPO3 CMS core one day.
The next level: Theme Packages
As good as Grid Elements is, it is only one component in a bigger set of extensions that makes TYPO3 the flexible CMS it is today. Therefore one might raise the question why not to combine all or at least some of the different approaches for templating and content rendering and focus them on one common goal. And indeed that is, what happened during the TYPO3 Developer Days 2013. The outcome: The Theme Packages project.
Though not directly related to the overall topic of this article series (TV replacements), I would like to point you to this project, which may fundamentally change the way you use TYPO3 in the future and may even alter the way TYPO3 is seen from outside its own community. Its big promise is, to bring one new main feature to TYPO3 CMS, which has long been missed: easy and straightforward theming of the TYPO3 frontend like you might know it from WordPress or other CM systems.
Grounded on Backend Layouts, Grid Elements and an enhanced Themes extension it will easily integrate with Fluidcontent and other content templating engines. It aims at providing “ready made packages containing backend layouts and grid layouts with appropriate frontend output” – the latter by using well known HTML Frameworks like Twitter bootstrap or Foundation as its basis – and thus making it as easy as possible to create a new TYPO3 project on a professional setup, while allowing you to easily switch between your own themes or any 3rd party themes (which may be provided by a central storage).
Like Grid Elements the Theme Packages project has a crowdfunding campaign running on startnext and is still in the funding stage. So if you like the idea as much as I do, support it!
[UPDATE February 07, 2015]
The creators of Grid Elements and Themes have written a book on TYPO3 Theming und Distribution (German only by now), giving an in-depth look on the new theming and distribution possibilities in TYPO3 CMS.