Contao news

Read the official Contao announcements.

Contao 4.11.0 is available

by Leo Feyer – Announcements

Contao version 4.11.0 is available. The release includes new features such as PHP 8 and Symfony 5 support, dynamic XML sitemaps, a simplified way to customize the back end, a new "figure" insert tag, custom regular expressions in the DCA and a lot more.


Supporting PHP 8 was more complicated than expected, since quite a few engine warnings were reclassified in PHP 8 (see and suddenly messages that were previously ignored as E_NOTICE now prevented code execution as E_WARNING. In particular, accessing undefined array properties in conjunction with the DCA was a major problem - the initial pull request for this contained over 1,800 changes in over 100 files alone.

Due to the large number of changes and the expected side effects, we decided not to include PHP 8 support in Contao 4.9 LTS as originally planned, but as a new feature in Contao 4.11.

Note on Contao 4.9 LTS

Since Contao 4.9 LTS will be maintained until February 2024, but there will not be an active version of PHP 7 after the end of 2022, it was clear to us that Contao 4.9 LTS must also run with PHP 8. We have therefore modified the error reporting in Contao 4.9.10 so that E_WARNINGs are automatically ignored if the installation runs with PHP 8. If you have customized contao.error_level in your app, you need to apply this change to run Contao 4.9 with PHP 8.

Resources: #2568, #2594, #2599, #2606, #2679

Dynamic XML sitemaps

Dynamic sitemaps are no longer written as static files on the server, but generated depending on the context when the /sitemap.xml route is called and stored in the HTTP cache. This way, protected pages can be found by the Contao crawler and included in the search index, too.

The output can be customized using the new ContaoCoreEvents::SITEMAP event.

Resources: #2295

Back end customization

To make it easier to customize the Contao back end, some configuration options have been added:

# config/config.yml
            app-name: Foobar
            app-version: 1.2.3
        badge_title: staging
            - files/backend/custom.css
            - files/backend/custom.js

The attributes will be added to the body tag as data attributes. The badge title will be displayed in both the login screen and the back end and it allows, for example, to distinguish between staging and production environments.

Resources: #1999

Insert tag "figure"

In addition to the existing {{image}} and {{picture}} insert tags, Contao 4.11 adds a {{figure}} insert tag, which uses the figure builder from the Image Studio. The three insert tags differ as follows:

  • {{image}}: outputs a single, non-responsive <img> tag
  • {{picture}}: outputs a responsive image, but does not take metadata into account
  • {{figure}}: outputs a <figure> element including all metadata

In addition, there is now a figure() method that can be used in custom templates.

Resources: #2607, #1937

Copy preview URLs

A new button has been added to the preview bar, which allows you to copy the current URL without the /preview.php fragment, in case you want to share the URL or further process it.

Resources: #1301

Overwrite the page title in FAQs

Similar to news and events, Contao 4.11 allows overwriting the page title, description and robots settings per FAQ.

Resources: #1779

Edit Twig files in the back end

Twig files such as the maintenance template can be customized in Contao by creating a bundles/ContaoCoreBundle/Error folder in the template editor and storing the service_unavailable.html.twig file there. Starting with Contao 4.11, these Twig files can also be edited directly in the back end.

Resources: #2051

Custom regular expressions

Under the key rgxp you can specify in the DCA which input is expected in a form field. In Contao 4.11, the options httpurl and custom have been added. The first one checks if the input is an absolute URL starting with http:// or https://, and the second one allows to store a custom regular expression under the key customRgxp.

Resources: #2297, Docs

Default values for contao.image.sizes

When defining multiple image sizes in the app configuration, it was previously impossible to avoid copying the same settings over and over again. Under the keyword _defaults:, you can now define default settings that apply to all image sizes.

# config/config.yml
                    jpg: [webp, jpg]
                resize_mode: crop

                width: 1000
                height: 500

                width: 500
                height: 250

                width: 100
                height: 100
                resize_mode: box

Resources: #2243

And a lot more

An overview of further changes can be found in the changelog.

Symfony compatibility

Contao 4.11 is designed as a transitional version from Symfony 4.4 to Symfony 5 and is therefore compatible with both major versions of Symfony. Our goal is to bring the LTS versions of both projects together, i.e. to run Contao 4.9 LTS with Symfony 4.4 LTS and Contao 4.13 LTS with Symfony 5.4 LTS.

Also see: Tickets | Version comparison | Changelog

Show all news


Add a comment

Please calculate 9 plus 3.