Creating and editing an entity: names, fields and record ordering
Describes Entities 0.7.0.
The entity form is where you define a content type: what it’s called, which fields each of its records has, and how its records are ordered. The same form creates a new entity and edits an existing one.
Where to find it
- New entity: New Entity on the Entities list, or
/admin/entities/new. - Existing entity: Edit in a row’s menu on the Entities list, or Edit Entity on the entity’s records page (
/admin/entities/01a1d6be-f408-772c-a908-a377b1c887c4/edit).
You need the Entities permission. The Backup Settings controls further down the form also need Change Entities settings (see the Entities settings guide).
An entity's definition.
Entity information
- Entity Name (Singular): the name of one record, for example “Brand”.
- Entity Name (Plural): the name of the list, for example “Brands”. The sidebar and the Entities list use it.
- Slug: the entity’s identifier, in snake_case (lowercase letters, digits and underscores, starting with a letter). It appears in the records page address (
/admin/entities/machine_type/data). The button beside it, Generate from Entity Name, fills it in from the singular name. - Description (Optional): a line about what the entity is for. The Entities list shows it under the name.
When the site has two or more languages, language tabs appear above these fields. The primary language, marked with a star, is required; the other languages are optional, and any field left empty falls back to the primary language value.
System settings
- Icon (Optional): a Heroicon name such as
hero-document-text. The Browse icons button opens a picker with a search box and categories; Clear icon removes the icon. - Status: Published (active), Draft (not visible) or Archived (hidden). Only published entities get a sidebar entry and appear in the Add menu of the records page.
- Record Ordering: Automatic (by creation date) or Manual (custom order). Manual allows drag-and-drop reordering of records. Dragging a record on the records page also switches the entity to manual by itself.
Fields
The Field Definitions card lists the fields every record of this entity has, in order. A new entity shows No Fields Yet and an Add Your First Field button.
Each field row shows its label, its key, its type and Required if it’s required. Choice fields also list their options. On each row:
- The up and down arrows (Move up, Move down) change the field’s position.
- The pencil opens the field for editing.
- The trash button (Delete field) asks Confirm? first; Cancel keeps the field.
Adding or editing a field
Add Field opens the Add New Field dialog (Edit Field when changing one):
- Field Type: grouped as Basic, Numeric, Boolean, Date & Time, Choice and Advanced. The types are Text, Text Area, Email, URL, Rich Text Editor, Section Heading, Number, Decimal, Boolean, Date, Select Dropdown, Radio Buttons, Checkboxes, File Upload, Image, Video and Relation.
- Field Label: the name shown on the record form.
- Slug: the field’s key, which must be unique within the entity. Generate from Field Label fills it in. If the key is already used, the dialog says so and the field isn’t added.
- Required Field: the record can’t be saved without a value. Not shown for a Section Heading, which is a display-only heading and holds no data.
- Default Value (Optional): saved with the field definition. Not shown for a Relation. In this version the admin record form doesn’t pre-fill new records with it.
Some types have extra settings:
- Select Dropdown, Radio Buttons and Checkboxes need at least one option. Add Option adds a row, the trash button removes one. Allow a custom “Other” option lets the person filling in the record type their own value.
- File Upload: Maximum Files (1 to 20), Max File Size (MB) (1 to 100) and Accepted File Types, a comma-separated list of extensions such as
.pdf, .jpg. - Relation: Links to picks which entity’s records this field points at. Allow linking to several records lets one record link to more than one. A site can switch relation fields off; then no new relation field can be added, though existing ones can still be edited.
- Image and Video hold one file from the media library.
Add Field (or Update Field) puts the field in the list; Cancel closes the dialog.
Saving
Changes to fields, like everything else on this form except the backup switches, are kept only when you save the entity. The buttons sit at both the top and the bottom of the form:
- Create Entity / Update Entity: save. A new entity then opens in its edit form; an existing one stays where it is.
- Create and Return / Update and Return: save and go back to the page you came from (or the Entities list).
- Reset Changes: throw away unsaved changes and reload the saved version.
- Cancel: back to the Entities list.
The save buttons are disabled while the form has errors. For a managed entity (one owned by another module, shown by a Managed by the … module banner), the slug, status and that module’s locked settings can’t be changed; saving with them changed is refused with a message telling you to revert them.
When someone else is editing
Only one person edits an entity at a time: the first one to open it. Anyone who opens it after sees This entity is currently being edited by another user. You are in view-only mode. and watches the editor’s changes arrive as they’re made. When the editor leaves, the next person in line takes over editing.
If the entity is changed, archived or deleted in another session while you have it open, a message tells you so.
What it doesn’t do
- An entity can’t be deleted from this form or anywhere else in the admin.
- The Decimal field type has no settings in this dialog for its number of decimal places or its step.
- A File Upload field can’t take an upload on the admin record form; see the record editor guide.
- The public form and backup sections of this page have guides of their own.