Score:3

Enable a module with sample config that depends on a theme

in flag

I have a submodule that provides some prepared configuration via config/install. The goal is to have devs enable that module to get a preconfigured set of content types complete with preconfigured fields, form displays, view displays, language settings, pathauto patterns, etc. The reason why this is all in a module and not a profile is because it's opt-in, i.e. devs may or may not want this preconfigured stuff upon install but have the option to install it later if they want to. However...

These prepared configurations have a dependency on a custom theme because some of the entity view display configs use Layout Builder, and use layouts from that custom theme (therefore their dependencies section will declare that custom theme as a dependency). This is intentional, the prepared configs have to use that custom theme. But those layouts also aren't specific to this submodule, they can be used outside of the prepared config and so can't be just moved over to the submodule.

If I remember correctly, modules can't install themes. So when I try to install, I get the following error.

Configuration objects provided by submodule_with_prepared_configs have unmet dependencies: core.entity_view_display.block_content.some_block.default (custom_theme)

What is the right way to introduce configuration from an enabled module that depends on a theme?

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.