Something I've noticed in reviewing GHOP tasks and introducing new users to Drupal is that almost every beginner makes the mistake of installing modules and themes into the /modules and /themes directory respectively, rather than the preferred method of installing in a subdirectory of sites/all.

While there is documentation and a readme in the site/all directory, there isn't a README.txt file in either the /modules or the /themes directory. I'm proposing the text in the following README.txt files.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dman’s picture

+1
Can't hurt.
Perhaps a reference to a 'best practices handbook page explaining the dir structure

... if there was such a thing! I can't find it!

( looked under Coding Standards Setting up a development environment Module developers guide ... The best mention I found was Creating modules - tutorials » Creating modules - a tutorial: Drupal 5.x » 01. Getting started.

ScoutBaker’s picture

FileSize
218 bytes

+1 as well.

The attached file changes "modules" to "themes" to match the file.

catch’s picture

Version: 6.0-rc2 » 6.x-dev
Category: feature » bug

I think this counts as a bug. If there's documentation on sites/* to link to that'd be good too.

Matt V.’s picture

Catch, under the "Getting Started » Drupal 5" section of the handbook, there is a section on Installing Modules and Themes (http://drupal.org/node/176043). Here are the most relevant pages. . .

Modules
http://drupal.org/node/176044

Themes
http://drupal.org/node/176045

catch’s picture

http://drupal.org/node/176043 is definitely the page to link to.

dman’s picture

Yes, but it makes no mention of the /sites/{sitename}/[modules|themes]/ option - which is also useful.

Something like:

Contributed modules and themes can also be placed in the directories /sites/{sitename}/modules/ and /sites/{sitename}/themes/. {sitename} will often be 'default'

Contributions placed there will only be available to the named site, whereas those under /all/* are available globally. For a single site setup, this probably won't make much difference to you but if you ever start modifying downloaded code for your own use, it's a good idea to isolate your changes from the clean versions. It's possible to have two versions of any module (even core ones) available on the site. Your installation will choose from the most specific one available (first /sites/sitename/modules, then /sites/all/modules then /modules). You can take advantage of this to test patches without damaging your existing files.

Also, you can place modules anywhere within subfolders underneath any of these /modules/ folders. They will be searched recursively when you visit your admin/build/modules page. You can use this to further organise your available items.

... Hm ... OK, maybe that's a bit heavy for 'getting started'. :-). But we do need the full picture in a handbook somewhere

catch’s picture

that's true - but if we link to that page (ideally with a path alias) we can open a docs issue to add the additional information. It's definitely the right page though.

Matt V.’s picture

FileSize
279 bytes
271 bytes

I've added a link in each file pointing to the handbook, using the existing URL. I'm not sure who can create a path alias for that handbook page, but I'll update the link if that gets added.

I think the information dman wrote would make a good addition to the handbook (it was new to me). I just recently got added to the documentation team. As soon as I get a chance to read up on all the documentation rules, I'll try adding that info. I think it makes sense to add as a sub-page beneath the Installing Modules and Themes handbook page.

dvessel’s picture

I think it would be nice if all the .txt in the root install were moved into a ReadMe directory and a lone "Read Me first.txt" briefly explaining which directories are off limits. With all the files scattered all over, I think there would be less chance of others reading any of them. Have one stand out and have clear and concise information there.

dman’s picture

Yeah, but I gotta disagree.
That one true readme would be too big and seldom get read.
A 1KB README you see by accident when just about to start adding stuff is much more serendipitous, and leads to a gradual learning process.
Heck, name it DONT_PUT_ANYTHING_HERE.txt :-)

catch’s picture

>> DONT_PUT_ANYTHING_HERE.txt

I'm sure there's a reason we don't do stuff like that, but someone want to tell me why not?

Matt V.’s picture

How about "WARNING.txt" or "CAUTION.txt". Those might get people's attention even more than README.

ScoutBaker’s picture

So are we expanding/changing the scope of this issue? If so, the title needs to be updated appropriately.

If not, can we get this change RTBC and create a new issue for the additional work and/or modifications?

Dan-902@drupal.org’s picture

As a newbie - the proposed XXXX_readme.txt are very clear and proposed locations are fine. I like having the "http://drupal.org/node/176043" link in the readme.txt file.

If you start having DONT_PUT_ANYTHING_HERE.txt files - you would need to put them in alot of places. So I don't like that idea...

dman’s picture

Yeah. Named text files are tacky, I didn't think it was a great suggestion. forget it.
But +1 on just getting these two normal READMEs in.

Matt V.’s picture

I added the information dman provided to the handbook page on "Multi-site Considerations" and renamed it to Directory Precedence and Multi-site Considerations.

Should I move forward with getting an alias created for the Installing Modules and Themes page? If so, can someone point me to the correct place to submit a request for an alias?

ScoutBaker’s picture

It would be nice to get an alias created. I'm not sure how that gets accomplished. Maybe a request in the documentation queue?

If getting the alias created is going to take too long, we should mark this RTBC so it can get included for the next RC. (Not sure how long before that happens.)

catch’s picture

I think you have to be a "site maintainer" to create aliases. Afaik this means a 'task' in the Drupal.org webmasters queue should work.

Matt V.’s picture

I've opened a request in the webmasters queue to add a URL alias.

Matt V.’s picture

In the alias request thread, dww made the point that the documentation page is currently under Getting Started > Drupal 5 > Installing Modules and Themes section of the handbook. To make the alias match the structure, it would need to be something along the lines of /getting-started/5/installing-modules-and-themes. It doesn't make sense to use an alias, if it points to the wrong version number. It seems likely that the page will eventually be moved into a non-version specific structure.

To avoid having this drag out until the handbooks can be restructured, is there any chance the README.txt files could be added as is?

ScoutBaker’s picture

Status: Needs review » Reviewed & tested by the community

That's two votes to get this in (and update later for the alias). RTBC.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Hm, this does not look like multisite friendly, suggesting sites/all to everyone. IMHO that text needs to be expanded on a little bit to cover the non-multisite (sites/all) and the multisite case as well.

ScoutBaker’s picture

FileSize
441 bytes
445 bytes

Updated to include a note for multisite installations. I tried to keep it short. We do provide a link to the updated documentation for more details.

ScoutBaker’s picture

Status: Needs work » Needs review

Whoops, set for review.

cburschka’s picture

I'm not sure if new files are easier to introduce via patch - in case they are, here is one to add both, as they are from #23 above.

(cvs add will of course still be required before these new files can be committed)

Gábor Hojtsy’s picture

Status: Needs review » Fixed

Committed this one, thanks.

keith.smith’s picture

Status: Fixed » Needs review
FileSize
1.72 KB

I'm sorry, but can I suggest a small follow-up patch?

In the original, there are lines like:

+under /sites/{sitename}/modules/, where sitename is the name of your site

I know what this means, but since it references "{sitename}" and "sitename", some might think that your directory should be formed as:

/sites/{example.com}/modules

The attached patch changes the second "sitename" to "{sitename}" so that they match.

Gábor Hojtsy’s picture

Status: Needs review » Fixed

Committed, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.