# Add fields to a type

A content field holds a piece of data of your content, such as a price, an area or a closing date. This article teaches you to create a field, to attach it to a type, to fill it in the editor and to spot what is missing.

## Before you start

- You must be a site administrator to create a field and attach it to a type. Your writers then fill it in the editor.
- A content field holds a piece of data of the content itself, such as a property’s area or an offer’s closing date. To link one piece of content to another, such as a property to its city, use a reference field: [Link your content together](https://lovelyrender.com/documentation/link-contents/).
- A field is defined once and attached to as many types as you want.

|  | The definition | Use by a type |
| --- | --- | --- |
| Where | The table **Content fields** of the screen **Content types** | The **Content fields** section of the type’s form |
| Settings | The label, the data type, the constraints and the choices | Required or not, the label and help specific to the type, the group, the display condition, the filter and the sort |

The same “Area” field can thus be required on properties for sale and optional on properties for rent. Changing its general label changes it on both types.

## Create a field

1. In the administration menu, open **Content types**.
2. Next to the **Content fields** table, click **Add content field**. The form opens in a panel on the side.
3. In **Label**, enter the field’s name as your writers will read it, for example `Living area`.
4. In **Type**, choose the nature of the data, for example **Number**. The **Constraints** or **Choices** sections appear depending on the type.
5. Optional: set the constraints. For an area, enter `8` in **Minimum** and `5000` in **Maximum**.
6. Optional: in **Help text**, write a sentence shown under the field in the editor, for example `In square meters.`
7. Click **Save**. The field appears in the table, with **0 uses** in the column **Used by**.

The form does not ask for a technical key. Lovely Render derives it from the label at creation.

**Warning:** The key and the type no longer change after creation. If you picked the wrong type, create the right field and delete the old one.

## Field types

| Type | What the writer enters | Constraints |
| --- | --- | --- |
| **Text** | One line of text. | **Min length**, **Max length** and **Pattern** |
| **Long text** | Text over several lines. | **Min length** and **Max length** |
| **Whole number** | A number with no decimals. | **Minimum**, **Maximum** and **Step** |
| **Number** | A decimal number. The decimal comma and thousands spaces are accepted. | **Minimum**, **Maximum** and **Step** |
| **Number on a slider** | A number set with a slider. | **Minimum** and **Maximum**, required, then **Step** |
| **Yes / no** | A switch. | None |
| **Date** | A date, with the picker or the keyboard. | None |
| **Date and time** | A date with the time. | None |
| **Time** | A time. | None |
| **Email** | An email address. | **Min length** and **Max length** |
| **Address** | A web address. | **Min length** and **Max length** |
| **Phone** | A phone number. | **Min length**, **Max length** and **Pattern** |
| **Choice** | One value from a list. | The list of choices |
| **Media** | An image or a video from the media library or from Pexels. | None |

The **Pattern** is a regular expression that the value must follow, for example `^0[1-9]` for a number that starts with 0.

### Understand constraints

A constraint shows a warning and never blocks saving. A number outside the bounds is brought back within the bounds when the writer leaves the field. A value that arrives through an import goes through as is and stays flagged.

If you tighten a bound later, the content that exceeds it can still be saved. It shows a warning to fix whenever you want.

## Write a list’s choices

A **Choice** field takes its values from a list. The **The choices are** list offers two sources.

| Value of The choices are | Effect |
| --- | --- |
| **Written below** | You write each choice with **Add choice**. A choice has a **Stored value** and a **Label**. The value never changes. The label is the text the writer reads and it can be translated. |
| **Design system:** followed by a family | The choices are the colors, gradients, shadows, text shadows, filters, clip paths, radii, text sizes or spacings of your design system. |
| **The icon library** | The choices are the icons of the library. |

A design system or icon list is read when the editor opens: it follows your palette changes. A color still chosen in a field cannot be deleted from the design system.

Beyond ten choices, the field becomes a list where the writer types to filter.

## Attach a field to a type

A field only shows in a type’s editor if the type attaches it.

1. In **Content types**, click **Edit** on the type’s row.
2. In the **Content fields** section of the form, click **Add a field**.
3. In **Field**, choose the field. The list gives its label and its key.
4. Set how this type uses it. The table that follows describes each setting.
5. Click **Save**. The type’s name appears in the column **Used by** of the field.

| Setting | Effect | Default value |
| --- | --- | --- |
| **Required** | The field counts in the missing data. It never prevents publishing. | Unchecked. |
| **Filterable** | The field can become a filter of a content list. | Unchecked. |
| **Sortable** | Your visitors can sort a list on this field. | Unchecked. |
| **Label on this type** | Replaces the general label for this type, for example “Plot area”. | **Inherited**, the general label. |
| **Help on this type** | Replaces the help text for this type. | **Inherited**, the general help text. |
| **Shown when** | Makes the field’s display depend on another field. The Show a field conditionally section details it. | **Always visible**. |

The order of the rows is the order of the fields in the editor. The **Move up** and **Move down** arrows of a row move it. The cross removes it.

If no field exists yet, the section says so. First create the field in the **Content fields** table, then come back to attach it.

## Arrange fields in groups

A group gathers fields in a collapsible panel of the editor, for example “Features”.

1. In the **Content fields** section of the type’s form, click **Add a field group**.
2. In **Group**, enter its name.
3. Optional: check **Open by default** so the panel opens expanded.
4. In the group, click **Add a field** for each field it holds.
5. Click **Save**.

Fields outside any group show before the groups. A group’s arrows move it among the others. **Remove this group** removes it with its rows.

## Show a field conditionally

A field can show only depending on the value of another. For example, “Salary” only shows if “Contract type” is not “freelance”.

1. On the field’s row, in **Shown when**, choose the field it depends on.
2. Choose the condition.
3. Enter the expected value. For several values, separate them with commas.

| Condition | The field shows when the other field… |
| --- | --- |
| **is** | has exactly the entered value. |
| **is not** | has a value other than the one entered. |
| **is one of** | has one of the entered values. |
| **is none of** | has none of the entered values. |
| **is not filled in** | is empty. |
| **is filled in** | has a value, zero included. |

For a **Choice** field, enter the choice’s saved value, not its label.

A hidden field is inactive: not required, not checked, not counted in what is missing. Its value stays saved and comes back when the condition shows it again.

**Warning:** A condition only reads a field that the same type attaches. A condition that targets another field is removed on save.

## Fill in the fields in the editor

1. Open a piece of content of the type in the editor.
2. In the right-hand sidebar, open the document tab, the one that carries the name of the type.
3. Open the tab **Data**. Fields without a group come first, then the groups.
4. Fill in the fields, then save the content.

![The Data · 1 tab of a project: the garden Area at 180 with its help From 10 to 20000, the empty Delivered on field marked Required, not filled in yet, then the open Site group with its duration, the automatic watering and the maintenance contract.](https://static.lovelyrender.com/uploads/2026/10/887-doc-contenus-donnees.png)

A required field carries an asterisk after its label. The tab title counts the required fields still empty: **Data · 1**. The counter goes down as you fill in.

The values are saved with the content. They enter its revisions: restoring a revision restores the values of that moment.

| Situation | Behavior |
| --- | --- |
| Empty required field | The message **Required, not filled in yet.** shows under the field. Publishing remains possible. |
| Number outside the bounds | The value is brought back within the bounds when the writer leaves the field. The messages **Below the minimum of…** or **Above the maximum of…** explain it. |
| Text too short or too long | The messages **… characters minimum.** or **… characters maximum.** show. |
| Text outside the pattern | The message **Does not match the expected format.** shows. |
| Emptied field | It stays empty. Empty means “not filled in”. |
| Zero or No value | It counts as filled in. |
| Media field | **Choose** opens the media library, **Replace** changes the media and **Remove** removes it. **Search Pexels** imports a photo or a video from Pexels with its credit. |

No message prevents saving. The **Data** and **References** tabs only appear on a type that has fields or references. The panel of an ordinary page opens on the tab **SEO**.

**Note:** After an accidental tab closure or a connection drop, the editor offers to restore your browser’s backup, field values included. Nothing is restored without your consent.

## Spot missing data

Three places show the required fields still empty.

| Where | Display |
| --- | --- |
| The title of the tab **Data** | The number of empty required fields of the open content. |
| The content list | Under the title of incomplete content, the number of missing data. Hovering over it names the fields. The **Data** > **Incomplete** filter keeps only that content. |
| The pre-publication screen | At a piece of content’s first publication, the **Data** panel lists the empty fields. You can still publish. |

The pre-publication screen does not appear on content already published. [Read your content list](https://lovelyrender.com/documentation/read-content-list/) details the list and its filters.

## Delete a field

1. In the table **Content fields**, click **Delete** on the field’s row.
2. Read the window. It says how many types use the field and how many pieces of content carry a value.
3. Click **Delete** to confirm.

The field leaves all types and the editor. The values already saved stay in your site’s database. The blocks that displayed the field stay empty and the page displays normally.

To remove a field from a single type, remove its row in the type’s form and keep the definition.

## See also

- [Show a content’s data](https://lovelyrender.com/documentation/display-content-data/)
- [List and filter your content](https://lovelyrender.com/documentation/list-filter-contents/)
- [Link your content together](https://lovelyrender.com/documentation/link-contents/)
- [Reuse a structure from one site to another](https://lovelyrender.com/documentation/reuse-structure-between-sites/)
