I was trying to make a recipe for backdrop cms and figured that it requires views bootstrap module in order to work. How do I enable the module in the recipe so that the user doesn't have to?

Accepted answer

I think that there are two parts to this question, or at least two parts to my answer. 

1) You can't simply enable one module in another module, because if the module is not already enabled, it's probably not even available. A module must be downloaded and installed, before it can be enabled. 

The best thing to do would be to add a dependency in the .info file for the recipe.

See: https://docs.backdropcms.org/creating-modules#info-files

By setting a dependency, it will force (and help) the user to download and enable any dependencies. So, while you can't download and enable it for them, you can make the process much easier this way. 

2) Sometimes your recipe might require special configuration settings. You can use the .install file in the module to set config settings in a module.
https:/docs.backdropcms.org/api/backdrop/core%21includes%21config.inc/function/config_set/1

See how we did it in the FAQ Recipe:https://github.com/backdrop-contrib/faq_recipe/blob/1.x-1.x/faq_recipe.i...

Comments

I think that there are two parts to this question, or at least two parts to my answer. 

1) You can't simply enable one module in another module, because if the module is not already enabled, it's probably not even available. A module must be downloaded and installed, before it can be enabled. 

The best thing to do would be to add a dependency in the .info file for the recipe.

See: https://docs.backdropcms.org/creating-modules#info-files

By setting a dependency, it will force (and help) the user to download and enable any dependencies. So, while you can't download and enable it for them, you can make the process much easier this way. 

2) Sometimes your recipe might require special configuration settings. You can use the .install file in the module to set config settings in a module.
https:/docs.backdropcms.org/api/backdrop/core%21includes%21config.inc/function/config_set/1

See how we did it in the FAQ Recipe:https://github.com/backdrop-contrib/faq_recipe/blob/1.x-1.x/faq_recipe.i...