Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed locations for Drupal module and theme types #42

Closed
wants to merge 1 commit into from
Closed

Changed locations for Drupal module and theme types #42

wants to merge 1 commit into from

Conversation

ricardjp
Copy link

In a Drupal project the modules directory is reserved for core module files. Custom or contributed modules should be placed in their own subdirectory of the sites/all/modules directory.

The same is true for themes which should be placed in their own subdirectory of the sites/all/themes directory.

In my humble opinion the DrupalInstaller should reflect those coding guidelines.

Thx.

@shama
Copy link
Contributor

shama commented Oct 29, 2012

Thanks! But have a look at #15 and #36. The locations for Drupal are intentional as it allows for multisite setups. You composer.json should be located in the sites/all/ folder.

@shama shama closed this Oct 29, 2012
@shama
Copy link
Contributor

shama commented Oct 29, 2012

Since this seems to be a much requested change. I wonder if it would be possible to detect if the folder sites/all/ is relative to the composer.json then assume it is a single site and prepend sites/all/ to the install path.

@RobLoach As my go to Drupal expert, does that sound sensible?

@RobLoach
Copy link
Contributor

Yeah, hardcoding "sites/all" here might not be the optimal solution. Using "modules", "themes" and "profiles", it allows supporting having composer.json in sites/all, sites/example.com, etc. Not to mention it would be future-proof with Drupal 8's defining its own composer.json.

Detecting where the Drupal root is an interesting idea. I got some of that working at DrupalInstaller.php. This was before Baton was highly adopted. Might be a good idea to move some of that over into the Composer Installers' Drupal installer.

Any thoughts on how the integration would look?

Thanks @ricardjp and @shama!

@lapistano
Copy link

I also do not like the circumstance (like mentioned in #15 & #36) to put the composer.json in /sites/all. For single site projects I keep the composer,json in the project root and use the "extra" branch of the composer/installers to relocate the 'installer-paths'. E.g.:

<--- Snip -->

"extra": {
        "installer-paths": {
            "sites/all/modules/{$name}/": [
                "drupal/imagefield_crop",
                "drupal/cck"
            ]
        }
    }

<--- Snip -->

At least for me this is working well.

@shama
Copy link
Contributor

shama commented Nov 10, 2012

Submitted the Drupal auto-detect as a new issue #44. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants