Who this is for. Content modellers looking for a place to store an attribute. After this page you know which records can carry a custom field, what each is commonly used for, and which records cannot carry one.
The sixteen entities
The Entity list on a custom field offers exactly these sixteen, and nothing else can be given a custom field in the admin. In the last column, Common marks a use that Core dna sites have in production; Suggested marks a use that follows from what the record is, offered as an idea rather than an established pattern.
| Entity | Module | Typically used for | Basis |
|---|---|---|---|
| Menu element | Menus | An icon, a CSS class, a link target, an in-page anchor, a description or teaser text, a banner image, a "mega menu" switch | Common |
| Menu | Menus | A CSS class or a heading for the menu as a whole | Suggested |
| Form | Forms | A tracking or variant name that the form's template or a script reads; an identifier for a file the form hands out | Common |
| Category | Common | For the general categories, such as a blog's: a display title that a listing shows instead of the category's name | Common |
| Tag | Common | An icon, or a switch that marks the tag as a filter facet | Suggested |
| Layout | Common | A setting about the layout itself | Suggested |
| SEO settings | Common | Open Graph or structured-data values beyond the standard SEO fields, on every record that has SEO settings | Suggested |
| Address | Common | Extra address lines, delivery instructions | Suggested |
| Person | Users | Profile attributes such as a job title or a date of birth | Suggested |
| User | Users | Account-level flags, or a records field linking the account to other records, such as a member's saved items | Suggested |
| Author | Users | A byline's biography, photo and social links | Suggested |
| Product | Products | A size chart, a code from an ERP system | Suggested |
| Product category | Products | A banner image, a code from an external system | Suggested |
| Book | Books | Metadata on a book beyond its authored layout areas | Suggested |
| Unit | Books | The same, for a unit | Suggested |
| Book page | Books | The same, for a book page | Suggested |
Books, units and book pages are the only records in the list that also have layout areas; how to choose between the two on them is on Custom fields or layout areas.
Person or user?
Both accept custom fields, and they are different records:
- A person is the identity and contact record, one per email address, and is shared by members and backend users alike.
- A user is a login account, one per username. It is either a frontend user, which this guide calls a member, or a backend user, such as an admin or a developer.
Put attributes of the human (a job title, a date of birth) on the person, and attributes of the account (a flag about the login, links to what the member saved) on the user.
Records that do not accept custom fields
- Pages, the records of the Pages module. Use a layout area on the page's layout instead. Book pages, by contrast, do accept custom fields.
- Groups. Put the attribute on the people or users in the group instead.
- Custom entity records. A custom entity definition already names the fields its records have.
- Invoices. The platform can store custom field values on an invoice, but Invoice is not in the admin's Entity list, so no invoice custom field can be defined there.
- Everything else outside the sixteen: blog posts, FAQ pages and questions, global components and the rest.