Content Blocks, Content Blocks, Content Blocks

Categories: Development, Community, TYPO3 CMS Created by Lidia Demin
Photo: Jack B. / Unsplash
With our announcement to introduce Content Blocks as a TYPO3 Core system extension at the TYPO3 Developer Days 2022, we have been very busy to make it happen.

The Structured Content Initiative is the core Strategic Initiative focused on improving the content editing user experience in TYPO3 CMS. Read our last update to learn more about what we’ve been working on.

What Is Development Without Issues?

As described in our last article, we started working on a concept to merge our Content Blocks with Mask as a TYPO3 Core system extension. The epic on forge describes our vision and implementation roadmap. The development for the Content Blocks has started on the current master of TYPO3 v12, and we took advantage of the TYPO3 Community Sprints in September and November 2022.

One might think this is an easy task: just copy and paste. But we had to learn that there was more than one issue to overcome - some of them easy, some of them big blockers.

Gerrit

Despite the Gerrit Review server being TYPO3’s contribution tool for years now, it is not suited for multiple people working simultaneously on the same feature. Even if each person works on different parts of the feature, merge conflicts occur, and it’s likely to override each other’s changes. After struggling with Gerrit for some time, we finally decided to move the development to the feature branch of a TYPO3 Core fork. This way, we also could better integrate other developers willing to help us with the feature. As soon as we felt ready to merge, we simply switched back to Gerrit.

Backend Previews

TYPO3’s backend previews - like live search, previews in the page and list module - are currently dependent on fields that actually belong to Fluid Styled Content (FSC). Those previews are hardcoded and not really configurable, which makes it nearly impossible to have good backend previews for Content Blocks that use their own fields only. Just think about a Slider element, which only has a text field per slide.

Luckily there is already a WIP feature for an alternative solution, but nothing is as easy as it sounds. In order to render customized previews, it is necessary to be able to fetch information about the record’s columns first. This is yet another necessary prerequisite that Benni Mack is currently working on.

Content Blocks Builder Module

Since the Content Block’s graphical user interface (GUI) for the Builder Module was merely a proof of concept, we took a look at the well developed GUI of Mask’s module. But since it is written in VueJs, we could not simply take it as-is for the system extension. We would have been forced to fully rewrite it with Lit. Even more, it would require to refactor the whole drag & drop behavior of TYPO3, which is an impossible task for v12.

But how to go without this popular feature? This is when Nikita Hovratov, Benni Mack and Susi Moog came up with the idea to extract that feature as a standalone service at the last TYPO3 Core sprint. Setting it up as an own website, similar to the Sitepackage Builder, gives us the advantage of providing and developing this feature independent from the TYPO3 Core release cycle. It could not only build, but also provide publicly available content blocks, similar to the TYPO3 Extension Repository (TER). One might argue that it isn’t directly accessible where it is needed — in the TYPO3 backend. But this is not impossible. The GUI can be integrated as a full-blown backend module in a later LTS version, when better technical possibilities (like installing Composer packages from the backend) are available to work with.

What Goes Into TYPO3 v12?

Although we didn’t promise to get anything into TYPO3 v12, we aimed, and are still aiming to make it. This is why we decided to make only the MVP features v12 ready:

  • Easy definition of a Content Block without PHP, TypoScript and TSconfig as a Composer package
  • Registration of a content block via Composer
  • Re-definition of all field types (no palettes or tabs yet)
  • Non-Composer mode will also be possible

Concentrating on the most important features also enabled us to rewrite the extension from scratch, in order to use Mask’s architectural benefits, and better match a system extension’s requirements.  We also added the prefix CB to the TYPO3 path utility — which means it can be used just like the EXT prefix throughout TYPO3.

What Next?

Once the patch is merged, we will start working on migration wizards for content blocks made with the community extension. Also, the Content Blocks Builder will be our top priority.

But, what if the patch will be rejected for TYPO3 v12? In this case, the Content Blocks community extension gets the next major version featuring all the refactored field types and a migration wizard. We won’t give up, and will concentrate all our forces on the system extension release. Our main goal is to make it right - not quick and dirty.

Keep In Touch

Thank you for your great feedback so far! Please keep testing and sharing your thoughts with us! You can reach us at #cig-structuredcontent on Slack, or join our calls on the 1st and 3rd Monday per month at 8 p.m. CET (7 p.m. UTC).

The Structured Content Initiative

Additional contributors for this article
  • Copy Editor : Felicity Brand
  • Content Publisher : Mathias Bolt Lesniak