You are on page 1of 1

0

I'm a bit surprised that you haven't found anything on the internet that could answer
your questions. Here is an article about coding standards for Drupal.

Anyway, here are several things I always do with naming, functions and directories
(that doesn't mean it's the best conventions):

• The only directory you should work in is ./sites (please never ever edit
something in the other directories).
• The contribute modules you download should be placed
in ./sites/all/modules/contrib
• The custom modules that you develop yourself should be placed
in ./sites/all/modules/custom
• When you create a custom module, chose a simple and suitable name of it,
preceded by the name of your project (better), for example myproject_blog.
• The .module and .info files should have the same name as your module's, for
example myproject_blog.module and myproject_blog.info. It will automatically
make the relationship between them.
• All the functions that appear in your .module file should be named by your
module's name, for example myproject_blog_revision_publish().
• If your custom module needs a table in your database, the name of your
module has to show up somewhere, for example $schema['myproject_blog']. If
you need more than one table, keep the prefix and add some explicit suffix.
• Idem for the custom themes in ./sites/all/themes.
If I forgot something, just ask ;)

You might also like