Contao news
Read the official Contao announcements.
Contao 5.4 - an iconic release
by Marcus Lelle – Current issues
When others are on vacation, Contao is hard at work: Contao version 5.4 is here.
The core team and many other developers have again processed many pull requests to make our favorite CMS even better. We are looking forward to the new features for users and developers.
Contao 5.4 will be supported with updates until February 2025. Version 5.3 will also continue to receive updates as an LTS version.
You can find out which Contao versions are currently supported in the Contao release plan.
For users
New, standardized icon set
The most visually striking new feature in Contao 5.4 is the new Lucide icons set. The replacement of the old icons from various sources has been discussed for a long time. Now Contao presents itself in a new look.
New anti-spam method for forms
With the help of Marco Cupic's preliminary work, Contao now has another tool in the fight against unwanted bots.
The open source solution ALTCHA is now available as an alternative to the security question to protect forms against misuse. ALTCHA uses a proof-of-work mechanism and does not require cookies or fingerprinting. The solution is therefore fully GDPR-compliant.
Pull request: #7054
ARIA labels in the navigation
For a further step towards accessibility, you can now define ARIA labels in navigation modules. As soon as there is more than one navigation element on the page, they should be identified by unique labels.
Pull request: #7209
The picker is no longer linked to the session
If you have filtered the pages and articles by a subpage, the selection modal for pages, files, etc. will still show you all paths.
Pull request: #6648
Contao 5.4 turns on the turbo
The new version introduces Turbo to the Contao backend and makes it noticeably faster thanks to the intelligent preloading of links. Further optimizations based on Turbo and Stimulus are planned for the future.
Pull request: #7011
For developers
Template attributes can be overwritten more easily
In html5 templates, you can now also use the attr()
function to easily customize templates such as the fe_page with less effort.
$this->extend('fe_page');
$this->rootAttributes = $this->attr()
->set('data-turbo', false)
->mergeWith($this->rootAttributes)
;
$this->bodyAttributes = $this->attr()
->set('data-controller', 'foobar')
->mergeWith($this->bodyAttributes)
;
PageFinder::getCurrentPage() is the new $GLOBALS['objPage']
globals
$objPage
or GLOBALS['objPage']
should no longer be used in future. PageFinder::getCurrentPage()
is the alternative.
Pull request: #6997
$page = $this->pageFinder->getCurrentPage($request);
$pageId = $page->id;
$pageAlias = $page->alias;
Twig slots
There is a new placeholder function slot
for Twig templates. In contrast to blocks
, slots
can be checked in advance for their existence by the inspector service. In this way, it will be possible, for example, to determine the possible slots for the layouts in the backend in future Contao versions and make them available for modules and the like. This is not currently used in the core.
Pull request: #6999
{# @Contao/foo.html.twig #}
<div class="wrapper">
{# simple usage #}
{% slot main %}{% endslot %}
{# usage with placeholders #}
{% slot left %}
<aside>{{ slot() }}</aside>
{% endslot %}
{# using optional fallback values #}
{% slot footer %}
<aside>{{ slot() }}</aside>
{% else %}
<!-- there is no footer -->
{% endslot %}
</div>
/** @var Contao\CoreBundle\Twig\Inspector\Inspector $inspector */
$inspector->inspectTemplates('@Contao/foo.html.twig')->getSlots(); // ['footer', 'left', 'main']
Much more
You can read about all the changes in detail in the changelog. Christian Feneberg has once again created a video about Contao 5.4 that is well worth watching. In German language only.
Compatibility
Contao 5.4 is compatible with
- Symfony 6.4 und 7
- PHP 8.1+
- Monolog 3
- Doctrine 3
- TinyMCE 5, 6 und 7
See also: Tickets | Compare changes | Changelog
Comments
Add a comment