0

I have a custom module that is installed on a number of sites. In an hook_update_n function I would like to add a completely new Paragraph type (not actual instance of a Paragraph) to every site, using the same configuration.

Adding or updating fields to an existing type is well documented, but I can't find out how to create an actual type (node or paragraph) programmatically.

0

There are two issues here. To start with, the config files for a paragraph type should be placed in the config folder of the module, for which there is now a console command. See Export Paragraph bundle with Drupal Console

Then there is the general problem, how sites can update the config of an already installed module. You'll find different solutions in this topic How do I update the configuration of a module?

| improve this answer | |

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.