Component field machine name
From version 6.1, machine names are used for component fields to link the field to elements in your component layout.
Setting the machine name
When you first add a field to your component form, you will see that the machine name is not yet set.
To set the machine name:
- Double click on the field to open its settings
- Enter a name in the Field label. This will be used to auto generate the machine name.
If you prefer to enter a different machine name, click on the Edit icon on the fields right
- Click Apply at the bottom of the field settings
- The field will now display the machine name.
Using the machine name to connect the field to your layout
One you have set the machine name, you can use it to connect the field data to elements on the layout canvas. The syntax is [field. followed by the machine name you specify e.g. [field.my-machine-name].
Changing the machine name
When you first add a field, the machine name will be auto-generated using the title for your field. Once you've clicked Apply, the machine name will no longer be auto generated. To change a machine name, click on the Edit icon on the field's right.
Deleting and recovering fields and field content
Machine names make it is possible to delete a field from a component and then add it back without losing any connection with content, as long as you know the machine name.
A history of the machine names used is stored with a component. If a field is deleted and another field is added with the same machine name, the history is used to establish the previous connection. You will be alerted via a modal that the machine name was previously used and may be connected to content.
If a field is deleted from a component, instances of the component will retain the field content until the component instance is opened, applied and the node is saved. At this point, the content for the field will be permanently deleted.