Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By lordrt21 on
Hello,
How can I make modules install in e.g. sites/all/modules/contrib instead of sites/all/modules?
Comments
If a contrib folder exists,
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
thank you for the info, will
thank you for the info, will give it a try with drush
Try registry Build
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
Exactly
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 )
thanks will give this 1 also
thanks will give this 1 also a try for my next dev
Is there a way to do it for web based installs?
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.