Skip to content

Linked fields

Intro

Linked fields allow admins to set up fields in an element that can mirror (link) fields in other elements, and then allow the population of those field values from any of the linked fields.

In order to link a field to another field, The admin can go to the linked fields section of the creator module. Only the following field types can be linked:

  • Single Line
  • Number
  • Multi-line
  • File upload

The following fields can be linked downwards to single line fields but it will cause issues if they are not read-only

  • Dropdown
  • Radio

In the linked fields section a creator can see existing linked fields and create a new one. When creating a linked field you have to select a field first and then you can choose fields to link to it.

In addition, only fields that don't already have a linked field are available for linking.

Linked fields table

The linked_fields table includes all the relationships between parent and child linked fields, as well as the readonly pivot data

Displaying a linked field

Linked fields have a small indicator that it is a linked field next to the complete indicator. The indicator will display Origin if it is the origin field.

Get linked field progress

When retrieving progress for a linked field, the CatalogueProgressService first checks if specific progress exists for the field. If not, then retrieves the progress for the linked field.

Storing linked field progress

The API to store field progress is in the CatalogueElementFormField.vue component and handled by the CatalogueElementFieldProgressController store class.

When saving a linked field progress, the user is served a prompt to change all the linked fields, or just the field in the element they are editing. If they chose to save just the field they are editing the standard process is followed. If they choose to change all the linked fields, the request

Readonly linked fields

Sometimes you may want to display a linked field but not allow it to be edited in a specific element. The readonly toggle allows admins to mark a linked field as readonly, so that it can only be edited in other places.