Search code examples
drupaldrupal-7

Possible to limit which custom modules for a multisite?


I'm using a multisite setup in Drupal 7. I'm wondering if it's possible to limit where a site can look for which modules to use. For example, there are a lot of modules I'd like to be able to use across all sites (../sites/all/modules/). But I would like Site A to have access to modules/custom/siteA, but not modules/custom/siteB.

Is this possible or do I have to share all modules across all sites?


Solution

  • You're thinking of it the wrong way; going depth first instead of breadth first. This is one of the "benefits" to going multisite.

    In Drupal 7, you should be able to put any modules you want only to appear to a specific site into it's sites/site-name/modules/ directory; site-name being whatever directory you mapped the sites/sites.php file to go to for the given URL. I think you should already have a settings.php file in your sites/site-name directory. Just add the modules folder and dump them in. I'm not really sure how to handle it further, or how to install site-specific modules from the site GUI (if that's possible.)

    I only put benefits in quotes because I've never been a fan of going multisite, but plenty of people have been more than happy to and it's worked out great for them.