Create a sub-theme

In this tutorial, we will create a sub-theme of the Garland theme.

  1. Create a directory for your sub-theme(e.g. .../sites/all/themes/mySubTheme)
  2. Create an .info file for your sub-theme(e.g. .../sites/all/themes/mySubTheme/mySubTheme.info)
    name = Mysubtheme
    description = A tutorial showing how to create a sub theme.
    core = 6.x
    engine = phptemplate  
     
  3. Add the following line in your sub-theme's .info file to declare that your theme is the sub-theme of another.
    base theme = garland
     
  4. You have to at least add a stylesheet to your sub-theme. Otherwise, your sub-theme will not inherit any of the parent theme's stylesheets. Therefore,
    create an empty css file(e.g. .../sites/all/themes/mySubTheme/AtLeastOne.css) and then add the following in your .info file.
    stylesheets[all][] = AtLeastOne.css  
     

In general, your sub-theme will inherit pretty much everything of the parent's theme(e.g. stylesheets, javascripts, Template.php, *.tpl.php, etc) and you will be able to override them too. For more details, see Sub-theme structure and inheritance.

Click on the mySubTheme.zip to dowload the complete theme of this tutorial.

AttachmentSize
Mysubtheme.zip507 bytes

Comments

Where are some great base themes

by the way - where are some great base themes such as Zen, AdaptiveTheme, which even include a pattern subtheme -
folder that you can copy and rename to have your new subtheme with lots of additional settings, very convenient!

All themes can be found at

All themes can be found at http://drupal.org/project/Themes .
http://drupal.org/project/zen
http://drupal.org/project/adaptivetheme