Hello,
How can I make modules install in e.g. sites/all/modules/contrib instead of sites/all/modules?

Comments

John_B’s picture

If a contrib folder exists, and you install contributed modules using drush, they are automatically placed in contrib. If you are using drush and wish to change this default behaviour, you can create a drushrc.php file for the user you are logged in as. Instructions are in example.drushrc.php. There was a sandbox project to achieve this without drush, which you could try out. Using drush is much the easiest option.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

lordrt21’s picture

thank you for the info, will give it a try with drush

sanjay.soni’s picture

To move existing module from "sites/all/modules" to "sites/all/modules/contrib" -
1. just cut and paste modules from Modules folder to Contrib folder.
2. Run registry build script using Registry build module.

Best Regards,
Sanjay
skype:er.sanjaysoni

dineshw’s picture

Exactly
Registry build makes sure module location will be updated.

Ideally,
Keep modules downloaded from drupal.org under sites/default/modules/contrib or sites/all/modules/contrib
Keep custom modules under sites/default/modules/custom
If you have applied any patches to contrib modules moves the module to sites/default/modules/updated and keep patches to sites/default/modules/patches/
If you are using features save features to sites/default/modules/features

Cheers
Dinesh Waghmare (LAMP)
UK, Surrey | India, Mumbai
Web Development | Digital Media Marketing | Strategic Consulting
--
m: +91 9867888266
(Drupal / Wordpress / SugarCRM )

lordrt21’s picture

thanks will give this 1 also a try for my next dev

DashDesai’s picture

Hi, I have the same question, but I prefer using the web based install option i.e. not Drush. Currently, I upload the module using the web ux and then manually move the folder and then activate it using the administration pages. I am using D8. If there is a config setting which the web administration pages look at then it will be great if I could set it to the /contrib location and avoid the manual moving step.