This documentation is for a version that has reached its End Of Life. Such versions are no longer supported and don't receive security updates. Consider updating to a newer version.
Customize field type metadata¶
When creating a content type definition, you add fields and configure their metadata, for example, whether they're required or translatable.
If needed, you can customize that some of those options are disabled in the back office for specific field types.
To do this, add custom service definition for ModifyFieldDefinitionsCollectionTypeExtension
.
For example, this configuration means that no Image field can be set as required in the definition of a content type:
1 2 3 4 5 6 7 8 9 |
|
fieldTypeIdentifier
refers to the identifier of the field type, in this case ezimage
.
modifiedOptions
lists the changes you want to make. The following options are available:
disable_identifier_field
- disables changing the field identifierdisable_required_field
- disables setting the field as requireddisable_translatable_field
- disables setting the field as translatabledisable_remove
- disables removing the field from content type definition (after it has been saved)