I'm building a very complicated paragraph layout with multiple levels of interconnecting paragraph types. At the moment, configuration and template files are all over the place.

So, I was wondering if there is a way to do the same using a module so, it will have all packaged up in one place.

Is there a way that a module to introduce a paragraph type?

Only things I've found so far was a module creating from paragraph types.

1 Answer 1


Everything will be stored in Drupal's configuration management. So you could add the relevant configuration into your /config/install folder of your module. When your module is first installed the configuration will be imported onto the site.

Anything else you might need to do in hook_install(), such as altering existing configuration, for example user permissions, which cannot be overridden this from your module.

Include default configuration in your Drupal module is relevant for you.

In terms of templates, that's fairly straight forward and a module can define its own templates using hook_theme(). There are plenty of examples and documentation.

  • Thanks @unusedspoon that is exactly what I was after, works like a dream! :)
    – Alimba
    Commented May 26, 2023 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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