-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DX] Allow Modules to Declare Layout Templates as Dependencies #6593
Comments
Yeah, I think that any type of project should be able to declare dependency on any other type of project. So that:
If the code where each of that happens is different, then it does make sense to have different issues for these. But if the code is the same, as I am suspecting (the installer module basically), then we might wanna consider consolidating all these into a single request. |
(I've broken up the first sentence to emphasize how I understand it.) While I agree with the first and the second feature, I'm skeptical about the third. It might work for new sites but not for existing ones. Existing sites are already using the default layout, and changing this to another template could change its appearance pretty much. |
Yup, downloading and enabling layout templates should be relatively easy to achieve (actually, templates are always "enabled" - but you can hide them from the setting page in So if the module is creating a new layout, and that new layout requires a specific template to work as designed, then that should be OK I guess. This assumes that the template that is required will be used only for layouts provided by that module though. Anything beyond that would need custom logic in order to present confirmation dialogs etc. etc. |
Description of the need
I'm creating a recipe module and would like my recipe to require a specific layout template and automatically enable that layout template as the default layout template.
Apparently, modules can only list other modules as dependencies. If I am wrong about this, let me know.
Proposed solution
Allow modules to declare layout templates as dependencies
Alternatives that have been considered
Allow modules to include layout templates within the module. I am not sure if this is possible already and I think it would be a better idea to simply allow modules to create seperate layout template projects and require them as a dependency.
Additional information
There is a similar feature request for themes.
#5316 Allow themes to declare dependencies on modules and layout templates
Official documentation for the .info file in layouts describes dependencies as:
An array of other modules that your module requires. If these modules are not present, your module cannot be enabled. If these modules are present but not enabled, the administrator will be prompted with a list of additional modules to enable and may choose to enable the required modules as well, or cancel at that point.
https://docs.backdropcms.org/creating-modules
Draft of feature description for Press Release (1 paragraph at most)
Backdrop now includes the ability for a module to declare a dependency on a specific layout template.
The text was updated successfully, but these errors were encountered: