Media Content Field

The Media Content field represents a field that can be created in Model Builder, allowing the inclusion of media files, such as images, videos, audios, playlists, podcasts, and other files in Entries.

This field enables users to enhance their content by inserting relevant media files within their articles. The following section explains the configuration of the Media Content in the model builder and its usage in an entry, depending on these configurations.

Media Content Field in Model Builder

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

  • No. of Media: This specifies the number of media files that can be added in the field. You can choose between "One Media" (which allows users to add only one media file) or "Multiple Media" (which allows users to add more than one media file). Once saved, this option cannot be changed for the field.

  • Media types: This specifies the type of media files that can be added in the field. You can choose any of the following options, such as Image, File, Video, Playlist, Audio, and Podcast. These options can be changed after saving the field in the model.

Once you have filled in the necessary field information in the configuration sidebar, you can click the "Create" button at the bottom, and the Media Content field will be successfully added to the model editor.

Media Content Field in Model Builder

Media Content Field Configuration

By selecting the Media Content 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 five tabs: General, Appearance, Validations, other Configuration, and Ratios. These tabs provide various settings and options for customizing the behavior and appearance of the Media Content field.

General tab

The General tab in the configuration of the Media Content contains essential field information, including Field name, Alias, Description, No. of Media, Media types, and Calculate metrics option.

The Calculate metrics option is represented by a switch toggle, which determines whether you want the media files added in this field to be calculated and displayed in the Metrics section on the right sidebar of the entry.

Note that while the Field name, Description, Media types, and Calculate metrics option can be modified even after saving the field, the Alias and No. of Media 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 Media Content 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: "Media Grid," 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 the option Show 'Upload new media', which determines whether the user can upload new media based on their permissions. By default, the "Yes" option is selected, which means that the "Upload" button will be displayed to the user when adding media to the respective field in the entry. If the "No" option is selected, then the "Upload" button will not be displayed to the user when adding media to the respective field in the entry.

Appearance Tab

Validations tab

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

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

  • Required Metadata: Enabling this option ensures that the added media files in the Media Content field are filled with the required metadata that can be selected, such as Title, Caption, Alt Text, Source, Author, Copyright, and Tags. It becomes mandatory to add the selected required metadata for the media files in the Media Content field before the entry can be published.

  • Specify number of assets: This option allows you to limit the number of assets that users can add into the Media Content field. Users will only be able to add media files 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 media files that fall between these two values.

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

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

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

Note that the "Specify number of assets" validation will be available only when the Media Content field is specified as "Multiple Media" under the No. of Media section. This configuration allows users to add more than one media file to the field.

  • Specify dimensions of images: This option allows you to limit the size of images that users can add to the Media Content field, specifically in terms of the width and height of the images. Users will only be able to add images within the specified minimum and maximum pixel values for width and height.

  • Specify labels of assets: Enabling this option allows you to specify the labels that are assigned to the assets and can be added to the Media Content field. This means that only the assets with the specified labels will be displayed in the modal and can be added to the field.

By leveraging the Validations tab, you can ensure that the Media Content 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 Media Content field, such as:

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

Ratios

In the Ratios tab, you can create ratios for the images that will be added to the corresponding media content field. To create a ratio, click on the "Create new +" button, which will open a modal where you can add the ratio name and the width and height of the ratio. For example, you can create a ratio named "Landscape" with a 3:2 width-to-height ratio. After configuring this option, users can set the focal point for the added images for each created ratio in the corresponding field.

Media Content Field in Entry Editor

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

  • One Media: If the No. of Media is set to "One Media" in the model, the user can only add one media file in the Media Content field in the entry editor.

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

  • Image: If the Media type section has selected the "Image" option, the user can add images in the field in the entry editor.

  • File: If the Media type section has selected the "File" option, the user can add files in the field in the entry editor.

  • Video: If the Media type section has selected the "Video" option, the user can add videos in the field in the entry editor.

  • Playlist: If the Media type section has selected the "Playlist" option, the user can add playlists in the field in the entry editor.

  • Audio: If the Media type section has selected the "Audio" option, the user can add audios in the field in the entry editor.

  • Podcast: If the Media type section has selected the "Podcast" option, the user can add audios in the field in the entry editor.

  • Images metrics: If the "Calculate metrics" option is selected in the model, the added media files will be calculated for the respective field, and the metrics will be displayed in the entry.

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

  • “Upload” button: If the “Show 'Upload new media'” option is set to "No" in the model, the "Upload" button will not be displayed in the Assets modal when browsing for media. If the “Show 'Upload new media'” option is set to "Yes" in the model, the "Upload" button will be displayed in the Assets modal when browsing for media.

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

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

  • Required metadata: If the Media Content field is specified with required metadata to be filled for the added media files, the user cannot publish the entry if the required metadata are not filled in. A warning message with a red color will be displayed under the field, indicating that the required metadata are required for the field.

  • Number of assets: If a specific number of assets is defined for the Media Content field in the model, the user cannot publish the entry if the added media files 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.

  • Specify dimensions of images: If specific minimum and maximum pixel values have been set for the Media Content field in the model, the user cannot publish the entry if the added images do not fall within the specified range. A red warning error will be displayed under the field, depending on the template configuration in the model.

  • Specify labels of assets: If specific labels have been set for the Media Content field in the model, the user can only add assets with the specified labels to the corresponding Media Content field in the entry.

  • Focal Point: If ratios have been created for the media content field in the model's configuration, users can set the focal point for the images in the field for each created ratio.

Media Content Field in Entry Editor