-1

We have a field.storage.taxonomy_term.field_name.yml file that adds the storage configuration for our custom field. The field is available to be added from the GUI to each vocabulary.

The issue we are facing is adding the field to every taxonomy automatically.

We have added the field from GUI and exported the configuration in order to change the form and we place the exported configuration in a file named field.field.taxonomy_term.field_name.yml, the problem that we are facing is modifying this config file in order to add them on all taxonomies. In the configuration exported where we found the vocabulary name we switch it to * and also the bundle property had the vocabulary name, that property can't be removed since it throws an error.

  • "...it throws an error." – What error? – leymannx Jan 19 at 8:03
0

You can use yaml files only if you create new vocabularies. Adding a field to existing vocabularies is the same as doing this for content types, both are bundles, content types for nodes and vocabularies for taxonomy terms. See this question:

8 Add content type field programmatically

  • Isn't the question a duplicate then? – leymannx Jan 19 at 8:04
  • @leymannx, I don't know, both questions a more specific versions of how to add bundle fields programmatically. – 4k4 Jan 19 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.