Glossary

FlexForm

Extra settings fields per record, stored as XML in a single database column.

What FlexForms are for

Some settings do not apply to a whole table but only to individual records of a particular type. A plugin that outputs a list might need the number of entries per page and a sort direction. Other content elements never need those fields.

For cases like that, FlexForm offers a field structure of its own that only appears on that type and is stored in a single column.

How it looks in the backend

For editors the difference is barely visible. The fields appear like any others, usually in a tab of their own on the record.

That inconspicuousness is why FlexForm gets used for more than it should. As the number of fields grows, a practical addition turns into a construction that is hard to maintain.

Keep the limits in view

Two things are worth knowing beforehand. First, the values are not readily searchable, because they are wrapped in XML. Second, a later change to the structure is manual work, because existing records do not travel along automatically.

Factor that in and FlexForm is a useful tool. Use it as a convenient substitute for proper fields and you pay for it later.

Common questions

When do you use a FlexForm and when a normal field?

A normal field is the better choice when the value makes sense for every record in the table and when you want to search or sort by it. Values like that belong in a column of their own.

FlexForm fits settings that only apply to one particular variant of an element, such as the display options of a single plugin. Creating a column that stays empty on every other record would be out of proportion.

Why does FlexForm have a reputation for being awkward?

Because the values sit as XML in one column. They cannot easily be evaluated with a database query, and changes to the structure do not automatically reach records that have already been saved.

Rename a field and you find it under its old name in existing records. Migrations like that have to be planned deliberately.

Settings nobody can keep track of?

When FlexForms have turned into a collecting point, it is worth looking at which parts belong in proper fields.