简体   繁体   中英

File structure for custom modules in Drupal 7

Note: I have already posted this question on [SE's drupal] but didnt got any positive response there so i am posting same question here again.


I want to organize non-core (modules that are not bundled with core) modules in Drupal 7. This is my proposed structure:

  1. Contributed modules - downloaded modules that are untouched
  2. Custom modules - downloaded modules that are modified to suit the requirement
  3. local modules - self-developed modules

I GUESS, the best approach for this is to make three folders within sites/all/modules like below:

  1. sites/all/modules/contrib
  2. sites/all/modules/custom
  3. sites/all/modules/local

Now, there are two ways to install a module:

  1. Manually
  2. From the admin panel

While installing the new module manually, everything is fine. I can just go to the directory and place the module there. But how to install a newly downloaded module in `sites/all/modules/contrib from admin-panel. Moreover, is there any better approach for organizing non-core modules?

Finally after banging head on google for hours, asking question on SO and SE's drupal and communicating with other users via comments, I cracked it...

Well, the directory structure is still debatable but satisfactory for me. But the answer to the most imp question is "DRUSH" .

Refer this and this node from Drupal. Collectively, it has everything needed to answer my entire question.

I would also like to point you to this answer which has provided the first and most-imp hint to me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM