Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By blakemorgan on
I'm trying to create a module that creates its own content types during installation. I understand that I need to use the Configuration API and the Entity API, but I'm having trouble adding Drupal-included fields to my custom type. From what I understand, I need to have a file for each field called file.file.node.content_type.field_type.yml
. Am I correct in my understanding? If so, why are their two fields and where can I find the options to place in that configuration file?
Comments
I mean field.field.node
I mean
field.field.node.content_type.field_type.yml
. Please pardon the typo.I always create the fields
I always create the fields through the admin API, then export them using the config manager module. If unsure about what to name the files, then you can export the entire config (which creates the files), then pick and choose your files from there.
check this ->https://www
check this ->
https://www.drupal.org/node/2528906