orchardcmsorchard-modules

Orchard CMS - Multiple Module Directories


Is it possible to configure multiple root Module directories in Orchard? My use case is that I want to keep my custom modules completely separate from the GIT clone of the orchard repository and to make it easier to pull down the latest orchard changes without having my customizations in the mix.


Solution

  • One solution for this problem that I often use is to store the modules in separate repositories and create hardlinks in the Orchard's Modules folder. For example, if you store your module's code in C:\Modules\MyModule and you want to use this with an Orchard enlistment in C:\Orchard, then you can create a hardlink (using mklink command in cmd.exe) in C:\Orchard\src\Orchard.Web\Modules which points to C:\Modules\MyModule. You can then use the module's code as if it was located directly in the Modules folder. You can even easily modify the code in the Modules folder and then commit the changes from C:\Modules\MyModule.

    Here is an example of a script which creates such links: https://github.com/Proligence/OrchardPs/blob/master/MapToOrchard.cmd