Skip to content
Marketing Factory Digital GmbH
Contact
Logo Marketing Factory Digital GmbH
  • Agency
    • About us
    • History
  • Services
    • Consulting, Analysis and Strategy
    • Programming and Development
      • Interface Development
      • PIM/ERP Links
      • Custom Development
      • Seamless CMS Integration
    • Hosting and Support
      • Operation on our Colocation Hardware
      • Cloud Strategies
    • Services with Third Parties
  • Technology
    • TYPO3
      • Current TYPO3 Versions
    • Shopware
    • IT Security
      • DDoS Protection
      • Continuous Upgrading
      • Privacy First
    • Tech Stack
      • Commitment to Open Source
      • Technology Selection
      • PHP Ecosystem
      • Containerisation & Clustering
      • Content Delivery Networks
      • Search Technologies
  • References
    • Projects
    • Clients
      • Client List
    • Screenshot of the homepage of the new Maxion Wheels websiteNEW: Relaunch of the corporate website of Maxion Wheels
  • Community
    • Community Initiatives
  • Blog
  • Contact
  • Deutsch
  • English

You are here:

  1. Blog
  2. Mistakes of the past: how we systematically replace Gridelements
  • Development
  • TYPO3
28.02.2022

Mistakes of the past: how we systematically replace Gridelements


This is the first part of a small blog series in which we want to show you our switch from Gridelements to containers and custom content elements.

It's not about badmouthing a long proven extension, but about learning from past mistakes when using it.

In the beginning, we will take a self-critical look back at past working methods before presenting our current concept.

Introduction

As you know, a website consists of a wide variety of content: Text, images, and interactive elements. The TYPO3 core provides some content elements, such as the versatile element "Text & Media".

For often-demanded modules like an Accordion or a Slider/Carousel, you can create custom content elements.

How we used to do it …

Some TYPO3 projects have existed far longer than the fluid templating we love today. In the days of css_styled_content, frontend rendering was still configured via TypoScript.

For some content, we have always defined custom CTypes, tailored to the specific purpose. For other elements, we extended them with layouts or frame classes.

The Gridelements extension has also served us faithfully for many years. Its feature list is long; but in addition to creating multi-column containers, we also used Gridelements to configure special content elements. And that's where the problems began.

Show larger version for: Illustration
Illustration: A gridelement accordion. On the left the content maintenance in the TYPO3 backend, on the right the output in the frontend.

… and what did not go well

TypoScript can be used to define that content elements within a grid element get a different rendering in the frontend. A group of "text & image" elements is then turned into an accordion or a group of tabs, depending on their parent grid element.

 

The desired appearance can be achieved in this way. But it also means: the same content element provides completely different output depending on its position in the layout. This behavior is not exactly intuitive for editors.

For us developers, templating via TypoScript is not something we enjoy either. Do I also want to talk about multiple nested elements and flexform settings? I'd rather not.

The step away from Gridelements

Of course, the extension is not to blame for our interpretation of Gridelements back then. However, it seems to have been common practice at that time; at least projects that we have taken over testify to that.
With new technical possibilities we have always adapted our way of working. And in the meantime, the time has come for us to replace Gridelements (for various reasons) with other solutions.

One of these solutions is the use of the Container Extension. But it is only a small piece of the puzzle for us.

How are we developing content elements today?

We create custom content elements as close to the TYPO3 core as possible. This simplifies future upgrades; in addition, the work steps are already familiar to every developer.

a) Content elements

  • We use frame classes or custom TCA fields for settings with little impact on the layout, e.g. a background color.
  • For the implementation of a special rendering, we define Custom Content Elements, e.g. for a key visual.
  • If several structurally similar elements are output in a group, we resort to inline elements (IRRE). Typical examples are Cards or the aforementioned Accordion.
  • If the Bootstrap Package is suitable for the project, this already provides us with some common content elements.

b) Page structure

  • With backend layouts, we define single and multi-column page layouts.
  • If we need variable multi-column layouts, we resort to EXT:container.
  • With EXT:content_defender we restrict the use of content elements in both backend layouts and container elements.
Show larger version for: Screenshot
A two-column container with two child elements: a text element on the left, an Accordion on the right.
Show larger version for: Screenshot of a card group
Card Group from the Bootstrap Package, implemented as inline elements.

How do we use container elements?

 

We draw a clear line when using container elements:

  1. First and foremost, they allow for a multi-column layout of content elements with different types.
  2. If necessary, they can also be used to group several content elements and, for example, to provide them with a background color.
    However, if the content structure of this group is always similar in practice, a custom content element is recommended here as well.

We will not implement a card layout with containers - IRRE elements are better suited for this. Also, containers should never (fundamentally) affect the rendering of their child elements.

Show larger version for: TYPO3 backend fields
The color drop icon shows the currently selected background color.
Show larger version for: TYPO3 backend fields
The large icon list illustrates the image alignment within a frame with fixed size.

In summary

Each new content element comes with a specific purpose and only contains the backend fields that are actually needed. Details in the TCA can make maintenance more user-friendly, for example by adding icons.

Structures are defined via backend layouts and, if necessary, made more versatile using container elements.

All elements always stay in a comprehensible behavior for the editor: a text element does not suddenly become a teaser just because it was positioned at a different place.

In the next part, we will get an overview of the existing project and develop a plan for the migration.

Sebastian Klein

Standing somewhere between the front-end and back-end. With a soft spot for usability and documentation. Always on the lookout for good practices.

More posts by this author

Get blog posts as RSS feed

All parts of this blog series

  1. Mistakes of the past: how we systematically replace Gridelements
  2. Planning is half the migration: What to consider when replacing Gridelements
  3. Improving TYPO3 Container elements
  4. Help me, TYPO3 Upgrade Wizard! How to properly migrate Gridelements records.

Please feel free to share this article.


Comments

No comments yet.

Write a comment.

I have been informed that the processing of my data is on a voluntary basis and that I can refuse my consent without detrimental consequences for me or withdraw my consent at any time to Marketing Factory Digital GmbH by mail (Marienstraße 14, D-40212 Düsseldorf) or e-mail (info@marketing-factory.de).

I understand that the above data will be stored for as long as I wish to be contacted by Marketing Factory. After my revocation my data will be deleted. Further storage may take place in individual cases if this is required by law.

  • Data privacy policy
  • Legal notice

© Marketing Factory Digital GmbH

Picture Credits
  1. "Article image Gridelements mistakes": © Sebastian Klein / Marketing Factory Digital GmbH
  2. "Illustration of Gridelements accordion": © Sebastian Klein / Marketing Factory Digital GmbH
  3. "Screenshot of two-column container": © Sebastian Klein / Marketing Factory Digital GmbH
  4. "Bootstrap Card Group": www.bootstrap-package.com
  5. "Backend: Color drop symbol": © Sebastian Klein / Marketing Factory Digital GmbH
  6. "Backend: Icon list": © Sebastian Klein / Marketing Factory Digital GmbH