Module Auto enable (further explanation)

Topics: Writing modules
Aug 31, 2012 at 9:18 AM

If Bertrand is looking at this question, I just wanted to explain in a bit more detail as twitter is a little limited in characters.  

We want to auto enable a module in orchard, so for the first time it installs, we would like it to be enabled.  As bertrand mentioned in his tweet (thanks for that btw) this was quite a nasty thing to do.  

The module we have written though is not to be shared and is for specific purposes in the company I am working for.  We have a dev, preprod and live server so we can test the module on the non live environments but we didn't want to have to keep enabling every module we write when doing a push to the live environment.

any help would be appreciated.






Sep 4, 2012 at 6:40 PM
Edited Sep 4, 2012 at 7:16 PM

Would a recipe which activated your module help?  The documentation has details on how to create a custom one.

Sep 12, 2012 at 10:18 PM
Edited Sep 12, 2012 at 10:19 PM

What do you mean "the first time it installs" and how is this different from saying that you want the module to be enabled the first time someone enables it? If you mean when it first gets noticed and compiled by the system, then no, there are no hooks to do that. You'd have to write your own extension loader I suppose.