Best practices

  • Drupal best practices

If you are going to invest the time to set up a CMS, then you should protect your investment by following some simple best practices. These guidelines are only suggestions. It is up to you to decide what is appropriate for your site.

The following list contains some quick pointers (for more detailed information, see the list of articles at the bottom of this page):

  • Plan your site. Drupal provides a good toolset to help you build your site but you still need to plan. Good wireframes and proper planning can avoid significant misunderstandings and problems later.
  • Plan for the future. You should revisit and reevaluate your site each time there is a major version release of Drupal. This does not mean you have to upgrade it, but you should evaluate and plan for an upgrade approximately each 12-24 months.
  • Get involved in the community. This will help you follow development trends and, while helping others, you may just come across a cool idea that solves your own problem.
  • Back up your site. Back up both the database and the files on the web server. Test your backups! If you don't test them, you have no idea if you are doing it right.
  • Test your PHP snippets. Drupal gives you a great deal of power and flexibility when using PHP code in blocks. Unfortunately, a stray character or a missing semi-colon breaks PHP. Drupal then attempts to evaluate this broken code on any requested page, the PHP interpreter chokes on it and therefore your whole site is broken. Fortunately, there is a very simple and easy solution. Instead of writing and testing your code inside the administer > blocks page, go to create content and create a new story or page node. Use PHP input format, write the code, and the Preview to debug your code. When you are satisfied that your code is working, copy and paste the code into the block.

Category: