Score:1

can a module introduce paragraph types and templates?

in flag

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.

Score:4
aq flag

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.

Alimba avatar
in flag
Thanks @unusedspoon that is exactly what I was after, works like a dream! :)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.