Log in Request my site

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.
  • A field is defined once and attached to as many types as you want.
A field’s definition and use
The definitionUse by a type
WhereThe table Content fields of the screen Content typesThe Content fields section of the type’s form
SettingsThe label, the data type, the constraints and the choicesRequired 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.

Field types

Field types and their constraints
TypeWhat the writer entersConstraints
TextOne line of text.Min length, Max length and Pattern
Long textText over several lines.Min length and Max length
Whole numberA number with no decimals.Minimum, Maximum and Step
NumberA decimal number. The decimal comma and thousands spaces are accepted.Minimum, Maximum and Step
Number on a sliderA number set with a slider.Minimum and Maximum, required, then Step
Yes / noA switch.None
DateA date, with the picker or the keyboard.None
Date and timeA date with the time.None
TimeA time.None
EmailAn email address.Min length and Max length
AddressA web address.Min length and Max length
PhoneA phone number.Min length, Max length and Pattern
ChoiceOne value from a list.The list of choices
MediaAn 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.

The sources of a Choice field’s choices
Value of The choices areEffect
Written belowYou 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 familyThe choices are the colors, gradients, shadows, text shadows, filters, clip paths, radii, text sizes or spacings of your design system.
The icon libraryThe 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.
The settings of a field’s use
SettingEffectDefault value
RequiredThe field counts in the missing data. It never prevents publishing.Unchecked.
FilterableThe field can become a filter of a content list.Unchecked.
SortableYour visitors can sort a list on this field.Unchecked.
Label on this typeReplaces the general label for this type, for example “Plot area”.Inherited, the general label.
Help on this typeReplaces the help text for this type.Inherited, the general help text.
Shown whenMakes 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.
Display conditions
ConditionThe field shows when the other field…
ishas exactly the entered value.
is nothas a value other than the one entered.
is one ofhas one of the entered values.
is none ofhas none of the entered values.
is not filled inis empty.
is filled inhas 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.

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.

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.

How fields behave in the editor
SituationBehavior
Empty required fieldThe message Required, not filled in yet. shows under the field. Publishing remains possible.
Number outside the boundsThe 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 longThe messages … characters minimum. or … characters maximum. show.
Text outside the patternThe message Does not match the expected format. shows.
Emptied fieldIt stays empty. Empty means “not filled in”.
Zero or No valueIt counts as filled in.
Media fieldChoose 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.

Spot missing data

Three places show the required fields still empty.

Where to see missing data
WhereDisplay
The title of the tab DataThe number of empty required fields of the open content.
The content listUnder 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 screenAt 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 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

Updated on

All documentation pages