Contao news
Read the official Contao announcements.
Contao 4.10.0 is available
by Leo Feyer – Announcements
Contao version 4.10.0 is available. The release contains new features such as an improved routing, mailer transports, enhanced simple tokens, featured events, an improved search, new insert tags, a new image service and a lot more.
Improved routing
The routing, i.e. assigning a URL to a page in the site structure, has been heavily revised in Contao 4.10. You can now define an individual URL prefix and URL suffix per website root. The URL prefix is no longer limited to a valid locale, so that each of the following URLs could be used for the "German/Switzerland" translation:
https://domain.com/de/
https://domain.com/de-ch/
https://domain.com/de-schweiz/
https://domain.com/schweizerdeutsch/
https://domain.com/schweiz/
It is even possible not to add a URL prefix to the main website and to only define one for the translated starting points:
https://domain.com/
https://domain.com/support
https://domain.com/de/
https://domain.com/de/support
Since some third-party extensions may not be compatible with the new routing, it is disabled by default and must be enabled in the app configuration as follows:
contao:
legacy_routing: false
Mailer transports
A mailer transport is an SMTP configuration (server, user name, password and sender) that is defined in the app configuration and can then be selected in the back end for sending mails. This makes it possible to send newsletters via a different SMTP mailbox and e-mail address than form data or system messages.
Resources: #1830, Documentation
Simple Tokens
Simple Tokens now use the Symfony Expression Language, which significantly extends the range of functions. For example, AND/OR checks and regular expressions using matches
are now possible.
{if value == "foo" || value == "bar"}
{if value in ["foo", "bar"]}
{if value matches "^https?://"}
The SimpleTokenParser
service allows you to process Simple Tokens in your own extension.
Featured events
Analogous to featured news items, it is now also possible to feature events and filter them accordingly in the event list modules.
Resources: #1465
Overwrite the meta robots tag in news and events
In addition to the meta title and the meta description, the meta robots tag can be overwritten per news or event in Contao 4.10.
Resources: #1778
Search improvements
The search function, especially the wildcard search, has become noticeably more powerful in Contao 4.10. In addition, the sorting of the results has been improved in that relevance is no longer calculated by the number of words but by TF-IDF (term frequency-inverse document frequency).
Resources: #1679
New insert tags
The new insert tags format_date
and convert_date
allow you to format a date or to convert a date from one format into another.
Resources: #1768
Form data as Excel CSV
Form data can now be forwarded in a CSV format that can be read by Microsoft Excel.
Resources: #1870
Symfony Mailer
Contao 4.10 uses the Symfony Mailer instead of SwiftMailer.
Resources: #1829
New commands
With the contao:user:create
and contao:user:list
commands, you can add or list back end users on the command line.
Resources: #1463
Image Studio
The Image Studio is a service that allows you to easily configure an image and then add it to a template. A Twig extension provides a helper for those who want to use the Image Studio in Twig.
Resources: #1753, #1528, Documentation
Extension of the back end access voter
The BackendAccessVoter
can now check all permissions of a back end user. The ContaoCorePermissions
class provides matching constants, so you can use the auto-completion feature of your IDE.
Resources: #1864
Custom page controller
With the new @Page()
annotation, you can tag controllers as pages. Contao 4.10 now supports the following service annotations:
Annotation | Explanation |
---|---|
@Callback | Tags an event listener as callback. |
@ContentElement | Tags a controller as content element. |
@CronJob | Tags a service as cron job. |
@FrontendModule | Tags a controller as front end module. |
@Hook | Tags an event listener as hook. |
@Page | Tags a controller as page. |
@PickerProvider | Tags a service as picker provider. |
And a lot more
An overview of further changes can be found in the changelog.
Symfony compatibility
Contao 4.10 is compatible with Symfony 4.4 LTS.
Update notes
In Contao 4.10, the rich text editor TinyMCE can be installed in either version 4 or version 5. When you upgrade from Contao 4.9, TinyMCE 5 is automatically installed unless you add the following in your composer.json
before the upgrade:
"require": {
"contao-components/tinymce4": "^4.7"
}
If you want to use TinyMCE 5, please remember to adapt your templates accordingly. The TinyMCE templates now use template blocks, so that you do not have to copy everything in your own templates (see #2135).
Also see: Tickets | Version comparison | Changelog
Comments
Add a comment