Using Conditionals in Title Format I've got a new channel for Authors where there are 3 fields:

firstName
middleName
lastName

and I'm using these fields to generate the Title of the channel entry. However I would like to add a conditional around middleName so that it isn't used if empty and I can avoid have double space between first and last name.

How can I do this?
The title field supports ternary syntax conditionals. You could do that like this:

{firstName} {middleName|length ? middleName ~ ' '}{lastName}

That says "if middleName has length, print it out, and append a space with ~.

Also part of the ternary syntax is the "else" statement, which looks like the below. This is the code I use for most of my asset alt texts for accessibility.

{{ asset.assetAltText|length ? asset.assetAltText : asset.title }}

If asset.assetAltText has a length, use that. Otherwise use the asset title as the alt text