Community Documentation

Upgrading Zen 5.x

Last updated March 25, 2011. Created by JohnAlbin on February 23, 2011.
Edited by Christopher Jam.... Log in to edit this page.

Upgrading Zen from 5.x-1.0 to 5.x-1.1…

If you followed the directions for creating a sub-theme, you will NOT have edited any files in the root of Zen and should only have modified files in your sub-theme's directory. So upgrading to the latest Zen will be easy.

  1. If you are replacing the Zen theme on a live server, place your site in maintenance mode.
  2. Download the latest Zen from http://drupal.org/project/zen
  3. Rename the zen folder in your Drupal installation to zen-old.
  4. Unpack the downloaded file and place the new zen folder in your Drupal installation next to your zen-old folder.
  5. Move your custom sub-theme folders from zen-old/ to zen/.
  6. Delete the zen-old folder. (Or at least move it out of the Drupal installation directory.)
  7. Turn off maintenance mode.
  8. To complete the upgrade, edit the following items in your sub-theme:

#199682: 'Submitted by' text is shown for content even if setting is disabled

Edit your sub-theme’s theme-settings-init.php files and change:

<?php
 
// Save default theme settings
 
variable_set(
   
str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
   
array_merge($defaults, theme_get_settings($theme_key))
  );
?>

to:

<?php
 
// Get default theme settings.
 
$settings = theme_get_settings($theme_key);
 
// Don't save the toggle_node_info_ variables.
 
if (module_exists('node')) {
    foreach (
node_get_types() as $type => $name) {
      unset(
$settings['toggle_node_info_' . $type]);
    }
  }
 
// Save default theme settings.
 
variable_set(
   
str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
   
array_merge($defaults, $settings)
  );
?>

#248780: admin table styles override update_status styling

Edit your subtheme.css and change:

  1. div.warning, tr.warning to div.warning, tr.warning, body.section-admin tr.warning
  2. div.error, tr.error to div.error, tr.error, body.section-admin tr.error
  3. all .section-admin #content … declarations to .section-admin … declarations.

#246110: zen.css breaks .container-inline

Edit your subtheme.css and, just before the .tips declaration, add:

  .container-inline div, .container-inline label /* Inline labels and form divs */
  {
    display: inline;
  }

#247960: Add THEME_preprocess() hook to Zen

Edit your sub theme’s template.php file and add:

/**
* Override or insert PHPTemplate variables into all templates.
*
* @param $vars
*   A sequential array of variables to pass to the theme template.
* @param $hook
*   The name of the theme function being called (name of the .tpl.php file.)
*/
/* -- Delete this line if you want to use this function
function STARTERKIT_preprocess(&$vars, $hook) {
  $vars['sample_variable'] = t('Lorem ipsum.');
}
// */

Upgrading Zen from 5.x-1.0-beta1 or later to 5.x-1.0

If you followed the directions for creating a sub-theme, you will NOT have edited any files in the root of Zen and should only have modified files in your sub-theme's directory. So upgrading to the latest Zen will be easy.

  1. If you are replacing the Zen theme on a live server, place your site in maintenance mode.
  2. Download the latest Zen from http://drupal.org/project/zen
  3. Rename the zen folder in your Drupal installation to zen-old.
  4. Unpack the downloaded file and place the new zen folder in your Drupal installation next to your zen-old folder.
  5. Move your custom sub-theme folders from zen-old/ to zen/.
  6. Optionally, compare the files in zen/STARTERKIT/ with the files in zen-old/STARTERKIT (or old/SUBTHEME if you have one.) If you see any changes, you can apply them to your custom sub-themes.
  7. Delete the zen-old folder. (Or at least move it out of the Drupal installation directory.)
  8. Turn off maintenance mode.

Upgrading Zen from a version before 5.x-1.0-beta1

Upgrading a theme that you have modified can only be accomplished by looking at each file and carefully merging the files from the latest Zen into your theme. This is such a pain in the ***, that Zen 5.x-1.0-beta1 was specifically designed to be easily updatable.

Good luck. You’re going to need it.

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 5.x
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here