Getting Ready for Craft 5

A collection of material on what you need to do to prepare your existing projects and plan new projects for Craft CMS 5.

Image

Craft CMS ver­sion 5 is now avail­able and ready for you to use. 

The new ver­sion Craft CMS fea­tures an improved user inter­face to enhance the con­tent cre­ation process, includ­ing ele­ment cards and inline edit­ing. It intro­duces enhance­ments in con­tent mod­el­ing, such as Matrix in Matrix and decou­pled entry types, as well as sup­port for long­form con­tent through an updat­ed CKEd­i­tor plugin. 

Addi­tion­al­ly, the update will include admin­is­tra­tive and devel­op­ment upgrades like lazy eager-load­ing and sup­port for PHP 8.2, along with secu­ri­ty improve­ments such as two-fac­tor authen­ti­ca­tion and passkeys.

And that’s not even everything!

Here are some details on the most impor­tant new fea­tures and changes with links to help­ful videos and articles:

Con­trol Pan­el updates #

Over­all, the Craft CMS con­trol pan­el received a minor facelift that includes a more sub­tle side­bar that is tog­gle-able, new icons, tweaked lay­out, increased use of slide­out com­po­nents for edit­ing ele­ments and set­tings, and sev­er­al acces­si­bil­i­ty improvements.

The con­trol pan­el changes aren’t sig­nif­i­cant enough that they’ll con­fuse your con­tent authors but it does look different!

🎥 Craft 5 Con­trol Pan­el Tour

🎥 Make Craft 5 Con­trol Pan­el Side­bar Default to Collapsed

Matrix Blocks are now Entries #

In ver­sions pri­or to Craft 5, Matrix was its own sep­a­rate ele­ment type. With the move of Matrix Blocks to entries (aka entri­fi­ca­tion), here’s how it’ll unfold:

  1. Matrix Blocks become Entries — each block you save, e.g. a CTA field with a URL field, and a text link field, will be saved as entries in the Craft data­base. These will have some sim­i­lar prop­er­ties to the Entries you’re used to.
  2. Matrix Block Types become Entry Types — you will cre­ate or choose an Entry Type for each block type you want in your Matrix field. Entry Types are a stand­alone thing now, so you can use any entry type in your Matrix block. 
  3. Matrix Fields become Glob­al Fields — pri­or to Craft 5, you cre­ate fields in a Matrix Field block as one-off, non-reusable, non-glob­al fields. Now all Matrix Fields are cho­sen from stan­dard fields (via the Entry Type). So, this means you can cre­ate one, say, Rich Text Field, and reuse that fields across Entry Types and field lay­outs for all sec­tions and Matrix block types.

This change tees up a few oth­er sig­nif­i­cant changes in Craft 5. Read on to find out!

🎥 Matrix Changes in Craft 5

Matrix in Matrix #

One of the side effects of mak­ing Matrix blocks entries and Matrix block types entry types in Craft 5, is that it the pos­si­bil­i­ty of Matrx-in-Matrix is now very real.

While we don’t want to tempt fate by doing too many nest­ed matrix fields and poten­tial­ly start­ing a series of inter­na­tion­al events that would low­er the DEF­CON to 1 and cause well-dressed indi­vid­u­als in sun­glass­es and ear pieces to show up our door…

But we do want to do matrix-in-matrix. And, with the new sup­port for par­tials ren­der­ing in Craft 5, we don’t even have to break a sweat writ­ing the Twig tem­plate code.

🎥 Matrix in Matrix Overview

Long­form con­tent with CKEd­i­tor #

What do we get when add togeth­er the updat­ed first-par­ty CKEd­i­tor plu­g­in, the entri­fi­ca­tion of Matrix block, and the ren­der­ing of par­tial templates?

Flex­i­ble long­form con­tent cre­ation that allows you to embed oth­er entries right inside of the rich text edi­tor. And, in a many cas­es, you can stop using Matrix for build­ing sim­pler content/​page builders and use CKEd­i­tor instead.

🎥 Long­form Con­tent Edi­tor with CKEditor

Cus­tom Ele­ment Index Views #

In Craft 5, we can now cus­tomize how the entries look on the ele­ment index page. Before Craft 5, we could cus­tomize the entries list­ing by adding and remov­ing columns, but we had no way to orga­nize the con­tent view oth­er than the table view of rows and columns.

The new view is a card view that allows for cus­tomiza­tion of entry con­tent shown on the card.

Here’s some­thing I cre­at­ed while rebuild­ing the TrailQuest project that is part of my Real World Craft CMS course:

Inline Ele­ment Edit­ing #

Ele­ment index­es now have the abil­i­ty to han­dle inline edit­ing for some first-par­ty fields and third-par­ty fields that imp­me­ment the InlineEditableFieldInterface.

This is help­ful for quick edits to ele­ment con­tent with­out click­ing into each ele­ment to make the change.

2FA and Passkey Sup­port #

There are two impor­tant account secu­ri­ty changes in Craft CMS 5 that will make user authen­ti­ca­tion more inline with best prac­tices for web applications.

The two new addi­tions to Craft 5 are:

  1. 2FA — two-fac­tor authen­ti­ca­tion using Duo Mobile, Google Authen­ti­ca­tor, Microsoft Authen­ti­ca­tor or a sup­port­ed pass­word man­ag­er like 1Password or Bitwarden.
  2. Passkey — A replace­ment for pass­words built on WebAu­thn. This type of pub­lic and pri­vate key authen­ti­ca­tion hap­pens at the oper­at­ing sys­tem lev­el and doesn’t require an addi­tion­al appli­ca­tion or set­up. On macOS, iOS, and iPa­dOS this means we can use Touch­ID or FaceID to log in to the con­trol panel.

🎥 2FA and Passkey in Craft CMS 5

📄 2FA and Passkey Sup­port in Craft CMS 5

Mul­ti­ple authors per entry #

Craft 5 adds a Max Authors” field to sec­tion set­tings, so you can allow more than one author per entry. This set­ting defaults to one, which is the stan­dard behav­ior pri­or to Craft 5, but can be adjust­ed upward as needed.

Authors are select­ed in the entry form side­bar using the famil­iar rela­tion­ship selec­tion UI.

🎥 Mul­ti­ple Authors Per Entry

When will Craft CMS 5 be released? #

Craft 5.0.0 sta­ble was released on March 26, 2024. You can now use it for new projects or to update exist­ing projects.

What are the sys­tem require­ments for Craft 5? #

Craft 5 will require the following:

  • PHP 8.2+ or Postgres
  • MySQL 8.0.17+ (note that the Craft CMS team no longer rec­om­mends MariaDB)
  • Com­pos­er 2.0+

See the Craft CMS require­ments for more infor­ma­tion on depen­den­cies or use the offi­cial serv­er check script to check your server’s com­pat­i­bil­i­ty.

Also, check out:

📄 Con­fig Changes in Craft CMS 5

Should I update exist­ing projects to Craft CMS 5? #

Deter­min­ing whether to update to Craft 5 hinges on the spe­cif­ic needs of your project, your com­pa­ny or client, and the cur­rent devel­op­ment sta­tus of your project.

Craft 5 intro­duces sig­nif­i­cant enhance­ments in con­tent author­ship and a com­pre­hen­sive reor­ga­ni­za­tion of how con­tent is stored in the data­base. This tran­si­tion may present more chal­lenges than the upgrade from Craft 3 to Craft 4, par­tic­u­lar­ly for projects uti­liz­ing com­plex page builders” or con­tent builders” with Matrix fields.

In Craft 5, all Matrix field blocks will trans­form into entries, and Matrix block types will become Craft entry types. Addi­tion­al­ly, fields with­in Matrix blocks will be con­vert­ed to glob­al fields, neces­si­tat­ing a thor­ough review and pos­si­ble con­sol­i­da­tion of fields.

Ulti­mate­ly, the deci­sion to upgrade depends on your project’s unique require­ments. If you are uncer­tain if your project should be updat­ed to Craft 5 or you are look­ing for a team to do, please get in touch.

Check project plu­g­in depen­den­cies #

Every plu­g­in you use in your projects will need an update to make it com­pat­i­ble with Craft 5. Your abil­i­ty to update a project to Craft CMS 5 will depend on a on a required plugin’s sup­port of Craft 5.

The Craft Plu­g­in Store does have a list­ing of plu­g­ins avail­able for Craft 5, includ­ing CraftQuest’s Bug­gy plu­g­in for learn­ing Xde­bug with our Xde­bug course!

Ready to learn Craft 5? #

If you’re already famil­iar with Craft, then I rec­om­mend watch­ing my series of videos cov­er­ing the most impor­tant fea­tures of Craft 5.

But if you’re new to Craft, then your first stop should be the Craft CMS 5 Quick-Start Guide.