News about Contao
Read the official Contao announcements.
Contao 3.1.beta1 is available
by Leo Feyer
Contao version 3.1.beta1 is available. Please do not use beta versions for productional websites! Download the release to check whether your website or custom extension needs adaptation.
Here are some of the highlight features in the new version. For a complete list, please read the changelog or check out the closed tickets of the release milestone (see the links at the end of the announcement).
Languages and dialects
As of Contao 3.1, dialects such as fr-FR are supported. They can be used in the website root page settings or as locales (note that locales are written fr_FR!) when translating the system.
Drag and drop most resources
Remember the two little arrows you had to click to move things up or down, e.g. in the list content element or page layout? They are all gone in Contao 3.1 and have been replaced with a drag handle to move the items via drag and drop.
Content element slider
A universal content element slider based on swipe.js has been added. It can be used similar to the accordion element: a start and a stop element wrap the content elements which are to be slided and a "moo_" or "j_" template, which is added to the page layout, initializes the script.
The slider supports swiping on tablets and mobile devices.
Article access protection
As of Contao 3.1, articles in addition to pages and content elements can be protected, so only certain member groups are able to access them in the front end.
TinyMCE link and image dialogs
When selecting pages or images in TinyMCE, the system now uses the Contao page and file picker instead of the TinyMCE drop-down menus.
Domain-aware navigation modules
So far, if a forward page, reference page or link insert tag pointed to another page in the site structure belonging to a different root page with a different domain, the link would end in a 404 error, because Contao tried to open the page under the current domain. In Contao 3.1, those resources are domain-aware and will forward to the correct domain, language and page.
As of Contao 3.1, modules can define other modules as dependencies in their
autoload.ini file. These dependencies then determine the order in which the modules are loaded and render workarounds like naming a module "zzz_custom" redundant.
Insert tag flags
Insert tags now support flags to e.g. pass the output to a PHP function. Usage example:
Currently supported flags are:
uncached: preserve the tag when writing the cache file
refresh: regenerate the output ignoring any cached version
addslashes: quote the output with slashes
stripslashes: un-quote the output
standardize: standardize the output
ampersand: convert ampersands to entities
specialchars: convert special characters to entities
nl2br: new line to <br>
nl2br_pre: new line to <br> except in preformatted text
strtolower: string to lower case
utf8_strtolower: Unicode aware string to lowercase
strtoupper: string to upper case
utf8_strtoupper: Unicode aware string to uppercase
ucfirst: make first character uppercase
lcfirst: make first character lowercase
ucwords: uppercase the first character of each word
trim: strip white space from the beginning and end
rtrim: strip white space from the beginning
ltrim: strip white space from the end
utf8_romanize: romanize the output
strrev: reverse the output string
encodeEmail: decode encoded e-mail addresses
decodeEntities: decode entities
number_format: format a number (System::getFormattedNumber())
currency_format: format a currency (System::getFormattedNumber())
readable_size: convert the output to a human readable size
File system improvements
The database-assisted file system (DBAFS) has been greatly improved to be more usable and run more stable. The improvements include:
- The file picker now shows the file system instead of the database
- You can switch from the file picker to the file manager in the pop-up dialog
- The file picker automatically adds the selected resources to the database
This means that you do not have to manually synchronize the file system and the database anymore.
- Added a breadcrumb menu to limit the nodes of the page and file picker
md5_file()is no longer applied to files bigger than 2 GB
- A folder hash is now calculated of the file names instead of their hashes
- All DBAFS-related routines have been centralized in the
- Permission to synchronize the file system can be given to regular users
New hooks in version 3.1
parseWidget: is called when a widget is parsed.
getPageLayout: is called right after the page layout object is instantiated.
modifyFrontendPage: is called right before a front end page is output.
The difference between the
modifyFrontendPage and the
outputFrontendPage hook is that the insert tags and dynamic script tags have already been replaced when the
modifyFrontendPage hook is called.