Reference Field

The Reference Field represents a field that can be created in Model Builder, allowing the inclusion of other entries in an Entry.

For instance, you can use this field to create relationships between different articles, avoiding the need to duplicate or re-enter content manually. The following section explains the configuration of the Reference field in the model builder and its usage in an entry, depending on these configurations.

Reference Field in Model Builder

When adding a Reference 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 Reference field.

  • No. of references: This specifies the number of referenced entries that can be added in the field. You can choose between “One reference” (which allows users to add only one referenced entry) or "Multiple references" (which allows users to add more than one referenced media). Once saved, this option cannot be changed for 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 Reference field will be successfully added to the model editor.

Reference Field in Model Builder

Reference Field Configuration

By selecting the Reference 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 Reference field.

General tab

The General tab in the configuration of the Reference field contains essential field information, including Field name, Alias, Description, and No. of references.

Note that while the Field name and Description can be modified even after saving the field, the Alias and No. of references 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 Reference field focuses on how the field will be displayed in the entries created by the model. For this field, there is only one available option: "Entry List" which is selected by default.

The Appearance 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 text field effectively.

Additionally, this tab has two other options:

  • Disable Create Button: This option determines whether the user can create a new entry based on their permissions. By default, the "No" option is selected, meaning the "Create" button will be displayed to the user when adding entries to the respective field in the entry. If the "Yes" option is selected, the "Create" button will not be displayed to the user when adding entries to the respective field in the entry.

  • Disable Browse Button: This option determines whether the user can browse for entries in the reference field. By default, the "No" option is selected, meaning the "Browse" button will be displayed to the user when adding entries to the respective field in the entry. If the "Yes" option is selected, the "Browse" button will not be displayed to the user when adding entries to the respective field in the entry.

Appearance Tab

Validations tab

In the Validations tab, you have the ability to apply constraints to the Reference field. These constraints enforce specific requirements on the field's input, ensuring that the entry cannot be published unless the Reference field adheres to these restrictions. The available options for validation include:

  • Required field: If you select this option, the Reference field must be filled when creating an entry. It becomes mandatory to add an entry in the Reference 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.

  • Accept only specified entry type: This option allows you to enable or disable the models from which the entries are created to be displayed in the Reference modal when adding entries. This means that only the entries from the enabled models will be displayed in the Reference modal when adding entries.

  • Allow duplicates: This option allows you to select and add the same entries multiple times in the entry editor.

  • Accept only a specified number of entries: This option allows you to limit the number of entries that users can add into the Reference field. Users will only be able to add entries within this specified range. The available options are:

    • Between: With this option, you can set both a minimum and a maximum value, limiting users to add entries that fall between these two values.

    • At least: This option sets a minimum value, and users must add entries that are equal to or exceed the specified minimum.

    • At most: This option sets a maximum value, and users must add entries that are equal to or below the specified maximum.

    • Exactly: With this option, you can set an exact number of entries, and users will be restricted to add entries within this defined range.

Note that the "Allow duplicates" and “Accept only a specified number of entries validations will be available only when the Reference field is specified as "Multiple references" under the No. of references section. This configuration allows users to add more than one entry to the field.

By leveraging the Validations tab, you can ensure that the Reference field in your model enforces specific constraints, maintaining data integrity and consistency in your entries.

Validations Tab

Other Configuration

This tab includes additional configuration options for the Reference field, such as:

  • Enable field in filter: When enabled, this option allows the selected reference field to be available for filtering in the entries listing for the corresponding model.

Reference Field in Entry Editor

The Reference 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 Reference field in the entry editor.

  • One reference: If the No. of references is set to "One reference" in the model, the user can only add one entry in the Reference field in the entry editor.

  • Multiple references: If the No. of references is set to "Multiple references" in the model, the user can add more than one entry in the Reference field in the entry editor.

  • Help Text Tooltip: If help text is added to the reference 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 reference 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.

  • “Create” button: If the “Disable Create Button” option is set to "No" in the model, the "Create" button will not be displayed in the Reference modal when browsing for entries. If the “Disable Create Button” option is set to "Yes" in the model, the "Create" button will be displayed in the Reference modal when browsing for entries.

  • “Browse” button: If the “Disable Browse Button” option is set to "No" in the model, the "Browse " button will not be displayed in the Reference modal when browsing for entries. If the “Disable Browse Button” option is set to "Yes" in the model, the "Browse" button will be displayed in the Reference modal when browsing for entries.

  • Required field: If the Reference field is marked as a required field in the model, the user cannot publish the entry without adding a reference to the respective field. A warning message with a red color will be displayed under the field, indicating that the Reference field is required.

  • Read-only: If the Read-only option is enabled in the model, the user can view this field as read-only.

  • Entry type: The user can add entries in the Reference field only created from the models which are specified in the model’s configuration. This also means that in the Reference modal when browsing for entries will only be displayed the entries created by the models which are specified in the model.

  • Duplicated reference: If the "Allow duplicates" option is enabled for the reference field in the model, the user can add the same entry multiple times in the field.

  • Number of referenced entries: If a specific number of entries is defined for the Reference field in the model, the user cannot publish the entry if the added entries do 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.

Reference Field in Entry Editor