What new features are in Craft CMS 4?

The new features in Craft CMS revolve around improving the developer experience.

Image

The fol­low­ing fea­tures were announced dur­ing Dot All 2021 as planned for Craft 4. Be sure to check the Craft CMS prod­uct roadmap for the lat­est on fea­tures planned for Craft 4 and beyond.

Col­lec­tions #

Use collect() instead of .all() to exe­cute an ele­ment query and return the results as a Lar­avel Col­lec­tion.

This set­up will be more flex­i­ble in instances where you are doing eager load­ing of ele­ments because you no longer have to update your code to iter­ate over an array.

You could change all of your .all() instances to .collect() and all exist­ing code will work. 

Mul­ti-Fac­tor Authen­ti­ca­tion #

The Craft CMS team plans to imple­ment mul­ti-fac­tor authen­ti­ca­tion in a gener­ic way that works for as many imple­men­ta­tions as pos­si­ble. Their aim to have flex­i­ble authen­ti­ca­tion chains so some steps are option­al and some are not. 

Inac­tive User Accounts #

This new fea­ture is already in the Craft 4.0 branch and allows an inac­tive user sta­tus so con­tent can be assigned to users with­out them yet hav­ing access. This fea­ture is aimed at agen­cies who pop­u­late con­tent and cre­ate accounts ahead of client hand-off.

Ele­ment Index Fil­ter­ing #

A new fil­ter search fea­ture in the ele­ment index views of the Craft con­trol pan­el will allow for more robust fil­ter­ing of elements.

Cus­tom Sources #

Cus­tom sources in Craft 4 will allow you to com­bine dif­fer­ent ele­ment types into a source that can be shown on the side­bar of ele­ment list­ing screens. You will cre­ate a new cus­tom source using the same gear menu and then choose which ele­ment types you want to include in the cus­tom source. 

Addi­tion­al­ly, source set­tings will be stored in project con­fig, so the set­tings are trans­portable across environments. 

Craft 4’s expect­ed release date is Q2 2022, with a beta ear­li­er in the year.