Drupal 7 : Building a sub theme from Zen
Why Zen theme ?
The Zen theme is the natural first step when theming Drupal. It reduces Drupal down to the essentials, allowing for a solid foundation to build up from. The alternative? Copying files from the core themes is messy, and starting from scratch is time-consuming.
Download the Zen Theme. Included is the base zen theme and sub-theme template, STARTERKIT.
Copy everything into sites/all/themes/zen on your web server. Move the STARTERKIT folder up a level into sites/all/themes. Separating the base theme makes upgrading zen the simple matter of overwriting the zen folder with the newer version. Files within the zen folder will remain unaltered. All configuration is done within the STARTERKIT sub-theme.
Copy everything into sites/all/themes/zen on your web server. Move the STARTERKIT folder up a level into sites/all/themes. Separating the base theme makes upgrading zen the simple matter of overwriting the zen folder with the newer version. Files within the zen folder will remain unaltered. All configuration is done within the STARTERKIT sub-theme.
Rename the folder “STARTERKIT” and “STARTERKIT.info.txt” file to match your new theme and remove “.txt” extension. For example, “mysubzen” and “mysubzen.info”. Open that info file and change the following lines:
name and description at your convenience as shown above …
Also Add line stylesheets[all][] = css/style.css and create this empty file style.css which will override every existing zen style from parent.
For example the style.css below will give this appearance (use firebug to locate classes and div tags) :
Do not Forget Templates files :
- Edit your sub-theme to use the proper function names.Edit the template.php and theme-settings.php files in your sub-theme’s folder; replace ALL occurrences of “STARTERKIT” with the name of your sub-theme.
For example, edit mysubzen/template.php and mysubzen/theme-settings.php and replace every occurrence of “STARTERKIT” with “mysubzen”.
It is recommended to use a text editing application with search and “replace all” functionality.
Important Note :
Remember to deselect “Rebuild theme registry on every page.” in Admin>Appearance>Settings(sub-theme)