Skip to main content

New in Craft CMS 5.6

Craft 5.6 came out two days ago. The Link field is finally complete, four releases after it shipped.

Four releases for a link field

The Link field arrived in August without a label input. Not without an advanced option, without a label. If an editor needed to set the text on a button, you added a Plain Text field next to it and explained that the two belong together.

5.4 fixed URL validation. 5.5 added the label and a checkbox for opening in a new tab. 5.6 adds an "Advanced Fields" setting covering the rest: Target, URL Suffix, Title Text, ARIA Label, Class Name, ID, and Relation. Opt-in per field, so editors only see what you've enabled.

Five months, four releases, for a field whose job is to store a link and a label. And the checkbox from 5.5 is already deprecated, because Target is now one of the Advanced Fields. Nine weeks from arrival to obsolete. I'd rather have waited a release and got it whole.

Color palettes

Color fields get a "Palette" setting that replaces "Presets," along with an "Allow custom colors" setting. With a palette defined, the field displays a color select dropdown as its primary input rather than a manual color field.

I've been defining brand colors as presets on client projects for years, and the problem was always the same: presets were shortcuts, not limits. The picker sat right there, and the field took anything you typed into it. Six months after launch a site would have four different greys because somebody eyedropped one out of a PDF.

The palette inverts that. The list is the input, and free colors are a setting you turn on rather than a hole you forget to close. Color`::$presets` is deprecated accordingly.

Copying field values between sites

Custom fields on element edit pages now have action menus, with "Copy value from site…", "Edit field," and "Copy field handle."

The first one is the useful one on multilingual projects. Content that's identical across sites (a price, a product code, an image) no longer has to be re-entered per site. Pick the source site, copy, done.

Redirects in a config file

Redirects can now be defined in `config/redirects.php.
`
There's no control panel interface, which sets the boundary clearly enough. This is for redirects that belong in version control next to the templates that made them necessary: the handful you write when you rename a section. For a relaunch, where somebody has to map four hundred old URLs and then watch which ones keep throwing 404s, this isn't it, and Retour still is.

Under the hood: `craft\web\RedirectRule`, a `RedirectEvent`, and `craft\controllers\RedirectController` deprecated.

Read-only settings

On environments where `allowAdminChanges` is disabled, system and plugin settings can now be viewed but not edited. Previously they were hidden entirely, so checking a production value meant either turning admin changes on or reading the project config by hand.

Field layout designers changed

The element library no longer sits in a persistent sidebar. Tabs have "Add" buttons that open a heads-up display. Elements can be added by clicking or pressing Return, and a newly created field lands in the tab immediately instead of needing to be dragged in.

That last part is the one that'll register. Creating a field from inside a layout and then having to find it in the library and drag it across was a small absurdity that had been there a long time.

Entry types, four releases later

Three entries that belong together. Entry type names and handles can now be overridden per section and per Matrix field. Upgrading to Craft 5 no longer renames entry types for uniqueness. And handles are now set back to their prior values for sections and Matrix fields during the upgrade.

This is also the fourth consecutive release to address entrification. 5.3 brought the merge commands, 5.5 dropped the unique-name requirement for sections, and now the renaming doesn't happen at all. The earlier releases cleaned up afterward; this one stops making the mess.

This rewards everyone who put the upgrade off, and leaves the early movers with the merge commands.

Front-end login and two-factor

The Login, Set Password, and error templates now render on the front end with more generic styling, and can be themed through a new `systemTemplateCss` config setting. A front-end login with two-step verification enabled redirects to `/login`, per the `loginPath` setting, to complete verification. `loginPath` and its siblings are respected in headless mode now, and verification emails link to the front-end Set Password form when the email originated there.

Standalone Live Preview

A new `preview/<elementId>` control panel route renders Live Preview on its own for a given element. Put a link in your front-end templates for logged-in editors and they go straight from the page to editing it.

Further down

Twig is updated to 3.15. The "Matrix field" entry condition rule is replaced by a general "Field" rule with a "has a value" operator. "Related To", "Not Related To", and "Author" rules accept multiple elements. There's a new "View users" permission, site-specific email setting overrides, an `elements/delete-all-of-type` command, and a `disable2fa config setting.
`
And another substantial accessibility block: eleven entries covering checkboxes with custom options, control panel icons, Selectize inputs, the image editor's rotation control, timepickers, progress bars announcing to screen readers, and a fix for field labels that weren't being read at all.

Conclusion

Two things finished this month that shouldn't have taken this long. The Link field is whole after four releases. The entry type renaming is fixed at the source, but only for everyone who hasn't already upgraded.

Both got there. Neither should have needed the trip.

Check the full changelog for everything not covered here.

Thomas Sausen

Web Developer

Self-employed web developer from Germany who started with WordPress websites in 2005, then moved to ExpressionEngine and lost his heart to Craft CMS in 2013. As the founder of Craftentries, he has been covering the Craft ecosystem since 2015.
  • Craft 59
    Craft 5.9 came out yesterday. Two or three of the additions will change how I set up the control panel on new projects.