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.
- Add a new text field to your content model, it can be localized.
- On the Appearance tab ensure that Combined Field is selected
- 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)
Assuming your locale is English, your entry title is
Category 1 the field value will be:
Category 1 (en)
When editing the entry the field is automatically updated with the locale (e.g. (en), (pt))
[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.
When editing the entry the field is automatically updated depending on what we put in title or parent fields.
When visualizing the entries will be easier to understand each entry using the combined field title.
Download and installation instructions on github https://github.com/pauloamgomes/contentful-combined-field