Boolean Field

The Boolean Field represents a field that can be created in Model Builder, allowing the inclusion of a "true" or "false" value in entries.

For instance, you can use the Boolean field to represent the premium status of a blog article in your site. The following section explains the configuration of the Boolean field in the model builder and its usage in an entry, depending on these configurations.

Boolean Field in Model Builder

When adding a Boolean 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 Boolean 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 Boolean field will be successfully added to the model editor.

Boolean Field in Model Builder

Boolean Field Configuration

By selecting the Boolean 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 three tabs: General, Appearance, and Validations. These tabs provide various settings and options for customizing the behavior and appearance of the Boolean field.

General tab

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

Note that while Field name and Description can be modified even after saving the field, the Alias cannot be modified once the field has been saved in the model builder.

Appearance tab

The Appearance tab in the configuration of the Boolean field focuses on how the field will be displayed in the entries created by the model. The available options in the Appearance tab are as follows:

  • Radio: This option provides two conditions: True condition and False condition, which are displayed below the appearance options. By default, the True condition has a custom text "Yes," and the False condition has a custom text "No," which you can modify according to your needs. Besides these, it can have a default value of "True" or "False," and you can also remove the default value by selecting the Clear button.

  • Checkbox: This option provides a single condition: True condition, which is displayed below the appearance options. By default, this condition has a custom text "Yes," which you can modify according to your needs.

  • Toggle Switch: This option provides a single condition: True condition, which is displayed below the appearance options. By default, this condition has a custom text "Yes," which you can modify according to your needs.

In addition to these Appearance options, the tab also includes the Help Text field. This field can be used to display a tooltip in the entry, providing users with additional guidance and understanding of how to use the Boolean field effectively.

Appearance Tab

Validations tab

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

  • Required field: If you select this option, the Boolean field must be filled when creating an entry. It becomes mandatory to input a value in the Boolean field before the entry can be published.

Note that the validation for the Required Field is only available for the Radio appearance option. For Checkbox and Toggle Switch, there are no validations to be selected.

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

Boolean Field in Entry Editor

The Boolean 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 Rich Text field in the entry editor.

  • Radio buttons: When the Appearance option is set to "Radio" in the model, the user will encounter two radio buttons in the entry. These buttons will have two custom text values assigned to them. One button will represent the True value, and the other will correspond to the False value.

  • Checkboxes: If the Appearance option is chosen as "Checkbox" in the model, the user will be presented with a single checkbox. The checkbox will have a default value (either True or False) based on the model's configuration. To select the desired value, the user can either check or uncheck the box.

  • Switch toggle: When the Appearance option is set as "Switch Toggle" in the model, the user will be presented with a switch toggle. This switch toggle will have a default value (either True or False) based on the model's configuration. To select the desired value, the user can simply toggle the switch on or off.

  • Help text: If a help text is added to the Boolean field in the model's configuration, it will be displayed as a tooltip near the field's title in the entry editor, providing additional guidance.

Boolean Field in Entry Editor