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.
Thomas Sausen
Four releases for a link field
The Link field arrived in August without a label input. 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 toggle 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. It's opt-in per field, so editors only see what you've enabled.
It took five months and four releases for a field that stores a link and a label, and the wait annoyed me. The toggle from 5.5 is already deprecated, because Target is now one of the Advanced Fields. I would have preferred to wait one more release for the complete field.
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.
On client projects, I've used presets for brand colors, but they never restricted anything. The color picker was still there, and the field accepted any value an editor entered. Over time, colors showed up that weren't part of the design.
With a palette, the list is the input, and custom colors are only possible if you enable them. Because palettes replace presets, the Color::$presets property is now deprecated.
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. You pick the source site and copy the value.
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, the config file isn't the right tool. That's when I use Retour, to see which old URLs keep returning 404s and still need a redirect.
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.
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
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 after the upgrade. This one prevents the renaming in the first place, which helps everyone who hasn't upgraded yet. Sites that upgraded early still need 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
The Link field and the entry type upgrade both took longer than they should have, but both are done. Check the full changelog for everything not covered here.
Thomas Sausen
Web Developer