Drupal 7 : Building a sub theme from Zen

Why Zen theme ?

The Zen theme is the nat­ural first step when them­ing Dru­pal. It reduces Dru­pal down to the essen­tials, allow­ing for a solid foun­da­tion to build up from. The alter­na­tive? Copy­ing files from the core themes is messy, and start­ing from scratch is time-consuming.

Down­load the Zen Theme. Included is the base zen theme and sub-theme tem­plate, STARTERKIT.

Copy every­thing 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 upgrad­ing zen the sim­ple mat­ter of over­writ­ing the zen folder with the newer ver­sion. Files within the zen folder will remain unal­tered. All con­fig­u­ra­tion is done within the STARTERKIT sub-theme.

drupal_subzen0Copy every­thing 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 upgrad­ing zen the sim­ple mat­ter of over­writ­ing the zen folder with the newer ver­sion. Files within the zen folder will remain unal­tered. All con­fig­u­ra­tion is done within the STARTERKIT sub-theme.

drupal_subzen

Rename the folder “STARTERKIT” and “STARTERKIT.info.txt” file to match your new theme and remove “.txt” exten­sion. For exam­ple, “mysubzen” and “mysubzen.info”. Open that info file and change the fol­low­ing 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.

drupal_subzen2

 

For example the style.css below will give this appearance (use firebug to locate classes and div tags) :

drupal_subzen1

drupal_subzen_sample

Do not Forget Templates files :

  1. 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 :

Remem­ber to des­e­lect “Rebuild theme reg­istry on every page.” in Admin>Appearance>Settings(sub-theme)

theme_development

 

extradrmtech

Since 20 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions. I am an experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. When not writing code, I like to dance salsa and swing and have fun with my little family.

You may also like...