Number Field
The Number Field represents a field that can be created in Model Builder, allowing the inclusion of numerical values in Entries.
For instance, you can utilize the Number field to represent the "Reading Time" of a blog article on your website. The following section explains the configuration of the Number field in the model builder and its usage in an entry, depending on these configurations.
Number Field in Model Builder
When adding a Number field in the model builder, you can configure its settings in the right sidebar. The field information that needs to be filled in includes:
Field name: This is the name of the field that will be displayed in entries and other relevant areas.
Alias: A required and unique identifier for the field, which cannot be modified once the field is saved.
Description: An optional field that allows you to describe the purpose or use case of the Number field.
Numbers: This specifies the type of number that can be entered in the field. You can choose between Integer (whole numbers like 1, 2, 3, ...) or "Decimal" (numbers with decimal places like 3.145...). Once saved, this option cannot be changed for the field.
Display: Determines how the field will be shown in entries and the value it can accept. You can select between Single (a single numeric value) or "List" (multiple numeric values). This choice cannot be altered after saving the field.
Once you have filled in the necessary field information in the configuration sidebar, you can click the "Create" button at the bottom, and the Number field will be successfully added to the model editor.
Number Field Configuration
By selecting the Number field in the model editor, you have access to several quick actions. These actions enable you to delete the field, open the configuration sidebar, and adjust the field's position within the model.
The Configuration sidebar consists of four tabs: General, Appearance, Validations, and other Configuration. These tabs provide various settings and options for customizing the behavior and appearance of the Number field.
General tab
The General tab in the configuration of the Number field contains essential field information, including Field name, Alias, Description, Number type, and Display settings.
Note that while Field name and Description can be modified even after saving the field, the Alias, Number type, and Display settings cannot be modified once the field has been saved in the model builder. These settings are fixed and cannot be changed once the field is created.
Appearance tab
The Appearance tab in the configuration of the Number field focuses on how the field will be displayed in the entries created by the model. The available options in the Appearance tab depend on the selected Display type of the Number field (Single or List).
If the Display type is set to Single, the following options can be chosen:
Number input: This option allows users to input numbers directly into the field. It can have a default value, which can be set in the "Default value" field. The default value will be shown in each entry as a default placeholder.
Dropdown: This option provides a predefined list of options, and users can select a single value from the dropdown menu. You can define the available options by specifying the "Predefined values" in the corresponding field. To add predefined values, click the "+Add" option on the right side of the field.
Radio: This option provides a predefined list of options, and users can select a single value using radio buttons. You can define the available options by specifying the "Predefined values" in the corresponding field. To add predefined values, click the "+Add" option on the right side of the field.
Rating: This option enables the creation of a rating system using one to five stars, allowing users to rank a specific kind of content. You can specify the "Number of stars" for the rating system and set a default value in the "Default value" field, which will be displayed in each entry as the default rating.
If the Display type is set to List, the following options can be chosen:
Number input: Similar to the Single display option, this allows users to input numbers directly into the field. It can have default values, which can be set in the "Default value" field. The default value will be shown in each entry as a default placeholder.
Checkbox: This option provides a predefined list of options, and users can select multiple values using checkboxes. You can define the available options by specifying the "Predefined values" in the corresponding field. To add predefined values, click the "+Add" option on the right side of the field.
Dropdown: This option provides a predefined list of options, and users can select multiple values from the dropdown menu. You can define the available options by specifying the "Predefined values" in the corresponding field. To add predefined values, click the "+Add" option on the right side of the field.
In addition to these Appearance options, the tab also includes the Help Text field. This field can be used to display a tooltip or inline text in the entry based on the selection, providing users with additional guidance and understanding of how to use the number field effectively.
Validations tab
In the Validations tab, you have the ability to apply constraints to the Number field. These constraints enforce specific requirements on the field's input, ensuring that the entry cannot be published unless the Number field adheres to these restrictions. The available options for validation include:
Required field: If you select this option, the Number field must be filled when creating an entry. It becomes mandatory to input a value in the Number field before the entry can be published.
In addition to this option, you can enable a condition that makes this field required depending on the value of another text field. After enabling this option, you can continue to fill in the fields as follows:
Field: Opens a dropdown menu listing all the text fields of the current model.
Operator: Opens a dropdown menu with operators such as contains, does not contain, equals, does not equal, exists, and does not exist.
Value: Enter the desired value.
Read-only: This option allows you to make the field read-only for users.
Additionally, you can set a condition that makes this field read-only depending on the value of another field. After enabling this option, you can continue to fill in the fields as follows:
Field: Opens a dropdown menu listing all the text fields of the current model.
Operator: Opens a dropdown menu with operators such as contains, does not contain, equals, does not equal, exists, and does not exist.
Value: Enter the desired value.
Unique field: Enabling this option ensures that the input value of the Number field is unique for each entry. It prevents duplicate values from being used in different entries.
Specify number range: This option allows you to specify a range of numbers that users can input into the Number field. Users will only be able to enter numbers within this specified range. The available options are:
Between: With this option, you can set both a minimum and a maximum value. Users will be restricted to input numbers that fall between these two values.
At least: This option sets a minimum value, and users must input a number that is equal to or greater than the specified minimum.
No more than: With this option, you can define a maximum value, and users must input a number that is equal to or less than the specified maximum.
By leveraging the Validations tab, you can ensure that the Number field in your model enforces specific constraints, maintaining data integrity and consistency in your entries.
Other Configuration
This tab includes additional configuration options for the Number field, such as:
Enable field in filter: When enabled, this option allows the selected number field to be available for filtering in the entries listing for the corresponding model.
Number Field in Entry Editor
The Number field in the entry will be displayed and can be used based on the configuration in the model. Let's explore some appearances and use cases of the Number field in the entry editor.
Single value: If the Display type is set to "Single" in the model, the user can only add a single numerical value in the entry editor.
List value: If the Display type is set to "List" in the model, the user can add more than one numerical value in the entry editor.
Integer number: If the Number type is configured as "Integer," the user can only add integer numbers (e.g., 1, 2, 3, etc.) in the entry editor.
Decimal number: If the Number type is configured as "Decimal" the user can add both integer and decimal numbers (e.g., 3.145, etc.) in the entry editor.
Help Text Tooltip: If help text is added to the number field in the model's configuration and its display is set to "Tooltip", it will be displayed as a tooltip near the field's title in the entry editor, providing additional guidance.
Help Text Inline: If help text is added to the number field in the model's configuration and its display is set to "Inline text", it will be displayed as inline text near the field's title in the entry editor, providing additional guidance.
Required field: If the Number field is marked as a required field in the model, the user cannot publish the entry without filling in the respective field. A warning message with a red color will be displayed under the field, indicating that the Number field is required.
Read-only: If the Read-only option is enabled in the model, the user can view this field as read-only.
Unique field: If the Number field is specified as a unique field in the model, the user cannot publish the entry if the number value entered already exists in another entry. An error message will appear on the left side of the entry editor, indicating that the field value is not unique in the collection.
Number range: If a specific number range is defined for the Number field in the model, the user cannot publish the entry if the entered number value does not fall within the specified range. A warning error with a red color will be displayed under the field, depending on the template configuration in the model.