Creating and Modifying Themes

As evidenced by the range of themes in the example education sites and these other samples below, it's possible using HTML and CSS to greatly style your Drupal site using the extensive class and id naming conventions for various content components.

Modifying an existing theme

The easiest way to create a theme is to modify an existing one. To begin modifying an existing theme, create a new folder in your themes/ directory. Find the folder in the themes/ directory for the theme you wish to modify. Copy the contents of the folder into your new folder.

  • You can accomplish a lot by merely modifying the existing style sheet for your theme. Change existing CSS settings or add in ones of your own.
  • Some themes use the XTemplate theme engine. You can modify the HTML in the xtemplate.xtmpl file in your theme folder to assist in your theme design implementation. The Drupal handbook provides extensive reference information about working with XTemplate.
  • Some themes use the PHPTemplate theme engine. PHPTemplate theme creation/modification can be a little more difficult than XTemplate, but it's a much more powerful theme engine, giving you more control over design. The Drupal handbook provides extensive reference information about working with PHPTemplate.
  • Note that Drupal has a default style sheet at misc/drupal.css which can be overridden in the theme style sheet. (Note: don't change this style sheet since it will then change the way any other Drupal themes work; override it in your theme style sheet).