I'm working on my first Drupal site. I uploaded a couple modules to the "root/modules" directory and they worked fine. Later, I uploaded modules to the "root/sites/all/modules" directory and they also worked fine. All modules seem to be working and I can't tell a difference between them through administration. What is the difference in how Drupal uses these directories?
I'm getting interested in trying to see if I can have a single code installation of Drupal for multiple sites with separate databases and domain names. These directories seem certain to play a role there somehow! Just want to make sure I am starting out correctly with the first site which would in theory be the code source for the other sites. If it turns out I need to move a module from one location to the other is that as easy as cut and past of the module folder?
Thanks!
Korak
Comments
---
sites/all/modules in a multisite install would be modules you want on ALL sites same if you add a themes folder at this level
sites/default/modules are modules you only want used on that specific site, the default site.
sites/multidomain1.com/modules are modules you only want to be used on that 1 site which is part of the multisite.
This change implemented in Drupal 5 was to ease the upgrading and updating as well as create a more organized folder structure.
Thanks!
Thanks for the quick response. If you don't mind a follow-up question, if I want to move the location of an uploaded module, can I just move it on the server or do I need to uninstall/enable it first and then reinstall/enable? When that is done is all configuration lost?
I went through this to bring
I went through this to bring Ubercart.org up to speed an found that I just had to move the folder (make sure not to leave two copies) and then just resubmit the form on the modules page. I didn't have to disable/re-enable them and everything still worked great. (One thing... if you're using smileys or some other filter that relies on image paths, you'll need to either flush your cache table or leave a link or copy of the image directory so those pages don't break.)
----------------------
Current Drupal project: http://www.ubercart.org
Helps if you are developing...
There is no functional difference between having your modules in /modules or in /sites/all/modules.
However, if you are doing development work and continuously pull from CVS then you'd want to set an ignore on your /sites folder so that CVS doesn't bother touching it when it updates. That way when you checkout from drupal CVS it can have it's way with your /modules directory but all of your sites configs and modules remain untouched between upgrades/checkouts/etc.
I don't know what CVS Is...
I don't know what CVS Is... but i understand what you're saying. Are the "root/drupal/themes" in use by the core installation, or could a person delete|consolidate them to .../sites/all/themes? What's the point of themes & modules:
For core installation
For all sites by default
For any default site
For specific sites.
I don't mind the last 2, but it seems like a "settings" file and consolidated themes & modules folders would be better. Hold on while i go learn how to be a developer and contribute more than suggestions ; D Seriously though, if anyone could explain how the "root" and the "all" modules & themes folders come into play differently, it would make me that much closer to being useful : D
Thanks,
citizen Vern
=-=
The reason why the sites/all/modules should be used. Simply to keep your contrib and core modules seperated. This allows you to delete the core modules folder in total during updates and upgrades. This would also explain why not to move the default themes provided by a Drupal install. as the themes folder would be removed during an update or upgrade. contrib and custom themes in sites/all or sites/default would be left entact.
keep in mind sites/default/modules can be used as well. This is what I use. The other benefit to this type of setup is for multisites. whereby modules used on "all" sites can go into sites/all/modules and themes in sites/all/themes
modules and themes not to be used on "all" go into their respective sites/ folder.
The above is just a longer explaination of : http://drupal.org/node/136596#comment-222181 which is my other comment in this thread.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )