Contao news

Read the official Contao announcements.

Contao 4.7.0 is available

by Leo Feyer – Announcements

Contao version 4.7.0 is available. The release contains new features such as native fonts in the back end, drag and drop in the template editor, an opt-in service, an improved front end preview bar, additional SEO settings for news and events and a lot more.

Native fonts in the back end #98

In Contao 4.7, we no longer use a web font in the back end but the system font of the respective operating system. This does not only fix font smoothing issues but also improves the optical integration of Contao into the system.

Drag and drop in the template editor #223

Like previously in the file manager, Martin has implemented drag and drop in the template editor as well in Contao 4.7. Templates can now be moved into a folder by dragging them.

Opt-in service #196

To better track opt-in processes, they are managed in a central place in Contao 4.7 and kept for the legally required retention period. The opt-in service can be used in custom bundles, too.

Front end preview bar #1640

Yanick has enhanced the front end preview bar in Contao 4.7 to show the title and URL of a page.

News reader in the news list module #39

To being able to add a news reader to the news list module, Fritz has adjusted the news list module analogous to the news archive module in Contao 4.7.

SEO settings for news and events #161

Thanks to Patrick Froch's effort on the Contao Camp in Leipzig, you can now overwrite the page title and page description per news or event.

2FA setup with a text key #86

In case someone cannot scan the QR code when setting up 2-factor authentication, Dave has added an option to complete the setup process with a text key.

Automatic HTTPS redirect #283

Thanks to Andreas having rebuilt the routing with the Symfony CMF router, visitors accessing the website via HTTP will be redirected to HTTPS automatically if the respective option has been enabled in the site structure.

Languages in the meta editor #6254

From now on, all languages that are present in the site structure are enabled automatically in the meta editor in the file manager and no longer need to be added one by one.

Repeated events #175

The text of a repeated event in the front end has been adjusted to make it more clear in which intervals the event takes place and when the next date is.

Trimming of the system settings #203

As discussed on the Contao Camp in Leipzig, we want to gradually trim the system settings in the back end. In Contao 4.7, the following fields have been removed as a first step:

  • Compress scripts: omitted
  • Template file types: omitted, we only support .html5 in the future
  • Character set: the input field has been removed, the value can still be changed in the config.yml or localconfig.php file
  • Timeout values: the input field has been removed, the value can still be changed in the config.yml or localconfig.php file
  • SSL proxy domain: the input field has been removed, the value can still be changed in the config.yml or localconfig.php file
  • Files URL/Assets URL: omitted in the back end, still present in the site structure
  • Website title: omitted in the back end, still present in the site structure
  • Editable file types: the input field has been removed, the value can still be changed in the config.yml or localconfig.php file
  • Enable auto_item: the input field has been removed, the value can still be changed in the config.yml or localconfig.php file

Exclude folders from synchronization #203

The option to exclude folders from synchronization with the database has been moved from the system settings to the file manager in Contao 4.7.

Minify the markup #203

The option to minify the HTML markup of the front end website has been moved from the system settings to the page layout in Contao 4.7.

Show downloads in the browser #20

Dennis Patzer has enhanced the download elements in Contao 4.7 so downloads either open the "Save as…" dialog or are shown directly in the browser.

Member comments #7

Thanks to Moritz Vondano's adjustments of the comments bundle, comments can be associated with members in Contao 4.7.

Warn when cookies are disabled #134

Contao uses a technique called "double submit cookie" to secure forms against CSRF attacks, therefore forms cannot be submitted if cookies have been disabled in the browser. The new js_nocookie.html5 template, which can be enabled in the page layout, adds a warning to each form in this case.

Check access to the template editor #224

Since Contao templates are PHP files, every user with access to the template editor implicitly has the full control over the system. Contao 4.7 therefore notifies the administrator in the user settings if a regular user has access to the template editor.

Export articles as PDF #65

Since exporting articles as PDF files is not something that is needed on every Contao website, the functionality has been moved to a separate bundle. Contao 4.7 therefore does not include TCPDF anymore, however it can be re-added at any time.

Slug service #222

Martin has enhanced the integration of his slug generator by adding a slug service to further simplify the automatic alias generation.

$alias = $container->get('contao.slug')->generate($pageTitle, $pageId);

onshow_callback #235

Kamil Kuzminski has added an onshow_callback to the DCA, which is run when the details view of a record is rendered.

contao.generate_symlinks event

To execute custom logic when symlinks are generated, the contao.generate_symlinks event has been added in Contao 4.7.

Security voter for back end users #122

Andreas has implemented a security voter, which reads the back end user settings.

// User has access to form ID 5
$authorizationChecker->isGranted('contao_user.forms', 5);

// User is allowed to access field "published" of table "tl_page"
$authorizationChecker->isGranted('contao_user.alexf', 'tl_page::published');

// Check access to folder
$authorizationChecker->isGranted('contao_user.filemounts', '/files/foo/bar');

Tagging services as DCA callbacks #39

Analogous to tagging services as hooks, Andreas has implemented tagging services as DCA callbacks in Contao 4.7.

Instantiate models with an array #121

Thanks to Andreas, Models can be instantiated with either a database result or an array in Contao 4.7.

$data = [
    'id' => 2,
    'name' => 'Theo Test',

$model = new UserModel($data);

Protecting folders #1601

Moritz Vondano has added an isUnprotected() method to the API to protect folders.

$folder = new Contao\Folder('/path/to/the/folder');

if ($folder->isUnprotected()) {
    // the folder contains a .public file and will be available via HTTP

Using routes in the DCA #116

Andreas has added support for routes in DCA attributes in Contao 4.7.

$GLOBALS['TL_DCA']['tl_table']['list']['operations']['foo'] => [
    'label' => &$GLOBALS['TL_LANG']['tl_table']['foo'],
//  'href'  => 'key=foo',
    'route' => 'my_bundle.custom_route',
    'icon'  => 'foo.svg'

PaletteManipulator::removeField() #1668

David Molineus has added a removeField() method to the palette manipulator, which allows to remove fields from a palette.

    ->removeField('published', 'publish_legend')
    ->addField('published', 'title_legend', PaletteManipulator::POSITION_APPEND)
    ->applyToPalette('default', 'tl_news')

Past and upcoming dates #175

With the new getPastDates() and getUpcomingDates() methods, you can retrive the past and upcoming dates of a repeated event in the template.

ContaoFrameworkInterface #276

The ContaoFrameworkInterface interface is deprecated as of Contao 4.7 and should no longer be used. Use the concrete class ContaoFramework instead.

class MyService
     * @var ContaoFramework
    private $framework;

    public function __construct(ContaoFramework $framework)
        $this->framework = $framework;

And a lot more

An overview of the other changes is available in the changelog.

Symfony compatibility

Contao 4.7 is compatible with the following Symfony versions: 3.4, 4.1, 4.2

Update notes

As mentioned above, TCPDF is no longer part of the Contao core distribution as of Contao 4.7. If you need the "Export article as PDF" functionality, please install the contao/tcpdf-bundle package; either in the Contao Manager or on the command line (composer require contao/tcpdf-bundle).

Also see: Tickets | Version comparison | Changelog

Back to the news overview.


Add a comment

Please add 5 and 1.

Subscribe to news