The Combined Field is a simple UI extension for Contentful CMS that provides a more enhanced way to deal with text fields that are built with dynamic information.

Usage

  1. Add a new text field to your content model, it can be localized.
  2. On the Appearance tab ensure that Combined Field is selected
  3. Provide your token based pattern, the pattern can use the following tokens:
  • [locale] - Will replace the token with the node locale
  • [field:your-field-name] - Will replace the token with the value of the field
  • [field:your-reference-field-name:field-name] - Will replace the token with the value of field that belongs to the reference.
  • [date:format] - Will replace the token with the date using the date-fns format (https://date-fns.org/v2.14.0/docs/format)

Example patterns:

Example 1 [field:title] ([locale])

Assuming your locale is English, your entry title is Category 1 the field value will be: Category 1 (en)

Example with locale

When editing the entry the field is automatically updated with the locale (e.g. (en), (pt))

Result with locale

Example 2 [field:parent:title] › [field:title]

Assuming you have have a simple content model composed by title and parent (reference to same model type) and you create a new entry with title Apple and parent pointing to Brands, your new title will be Brands › Apple.

Configuration

When editing the entry the field is automatically updated depending on what we put in title or parent fields.

Entry edit

When visualizing the entries will be easier to understand each entry using the combined field title.

Entries

Download and installation instructions on github https://github.com/pauloamgomes/contentful-combined-field