Hi everyone,

I am now experiencing with Drupal and I find it interesting and a little frustrating at the same time. I am working on my portfolio and I wanted to create my own design using Zen Sub Theme. I followed the readme.txt instructions step by step and for some reason my newly created sub theme won't show up in the appearance panel. I am hosting my site local trough MAMP, and the path of the zen folder is drupal/sites/all/themes/zen. I placed a copy of the STARTERKIT folder under drupal/sites/all/themes and renamed it nico. Inside the nico folder, I renamed starterkit.info.txt to nico.info. Also, I replaced all "Starterkit" with "nico" in nico.info, template.php and theme-settings.php. After all these, I cleared the cache in my local drupal site and I can see the Zen theme under Appearance, but the newly created sub theme (nico) is not showing up. I don't know where I went wrong...

Thank you for taking your time to read this and I greatly appreciate your help.


nico.info looks like this:


; Drupal's .info files allow themers to easily specify some of the static
; properties of your theme. Properties such as its name, stylesheets,
; javascripts, and block regions.
;
; Drupal 7 stores a cache of the data in this .info files. If you modify any
; lines in this file, you MUST refresh Drupal 7's cache by simply visiting the
; Appearance page at admin/appearance.

; The name, description and screenshot used for this theme on the Appearance
; page at admin/appearance.

screenshot = screenshot.png
name = Nico
description = Nicoleta Graniceru's sub theme.

; This theme is compatible with Drupal 7 core. And it is a sub-theme of Zen.

core = 7.x
base theme = zen

template.php looks like this

<?php
/**
* @file
* Contains the theme's functions to manipulate Drupal's default markup.
*
* Complete documentation for this file is available online.
* @see https://drupal.org/node/1728096
*/

/**
* Override or insert variables into the maintenance page template.
*
* @param $variables
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("maintenance_page" in this case.)
*/
/* -- Delete this line if you want to use this function
function nico_preprocess_maintenance_page(&$variables, $hook) {
// When a variable is manipulated or added in preprocess_html or
// preprocess_page, that same work is probably needed for the maintenance page
// as well, so we can just re-use those functions to do that work here.
nico_preprocess_html($variables, $hook);
nico_preprocess_page($variables, $hook);
}
// */

/**
* Override or insert variables into the html templates.
*
* @param $variables
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("html" in this case.)
*/
/* -- Delete this line if you want to use this function
function nico_preprocess_html(&$variables, $hook) {
$variables['sample_variable'] = t('Lorem ipsum.');

// The body tag's classes are controlled by the $classes_array variable. To
// remove a class from $classes_array, use array_diff().
//$variables['classes_array'] = array_diff($variables['classes_array'], array('class-to-remove'));
}
// */

/**
* Override or insert variables into the page templates.
*
* @param $variables
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("page" in this case.)
*/
/* -- Delete this line if you want to use this function
function nico_preprocess_page(&$variables, $hook) {
$variables['sample_variable'] = t('Lorem ipsum.');
}
// */

/**
* Override or insert variables into the node templates.
*
* @param $variables
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("node" in this case.)
*/
/* -- Delete this line if you want to use this function
function nico_preprocess_node(&$variables, $hook) {
$variables['sample_variable'] = t('Lorem ipsum.');

// Optionally, run node-type-specific preprocess functions, like
// nico_preprocess_node_page() or nico_preprocess_node_story().
$function = __FUNCTION__ . '_' . $variables['node']->type;
if (function_exists($function)) {
$function($variables, $hook);
}
}
// */

/**
* Override or insert variables into the comment templates.
*
* @param $variables
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("comment" in this case.)
*/
/* -- Delete this line if you want to use this function
function nico_preprocess_comment(&$variables, $hook) {
$variables['sample_variable'] = t('Lorem ipsum.');
}
// */

/**
* Override or insert variables into the region templates.
*
* @param $variables
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("region" in this case.)
*/
/* -- Delete this line if you want to use this function
function nico_preprocess_region(&$variables, $hook) {
// Don't use Zen's region--sidebar.tpl.php template for sidebars.
//if (strpos($variables['region'], 'sidebar_') === 0) {
// $variables['theme_hook_suggestions'] = array_diff($variables['theme_hook_suggestions'], array('region__sidebar'));
//}
}
// */

/**
* Override or insert variables into the block templates.
*
* @param $variables
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("block" in this case.)
*/
/* -- Delete this line if you want to use this function
function nico_preprocess_block(&$variables, $hook) {
// Add a count to all the blocks in the region.
// $variables['classes_array'][] = 'count-' . $variables['block_id'];

// By default, Zen will use the block--no-wrapper.tpl.php for the main
// content. This optional bit of code undoes that:
//if ($variables['block_html_id'] == 'block-system-main') {
// $variables['theme_hook_suggestions'] = array_diff($variables['theme_hook_suggestions'], array('block__no_wrapper'));
//}
}
// */


theme-settings.php looks like this:


<?php
/**
* Implements hook_form_system_theme_settings_alter().
*
* @param $form
* Nested array of form elements that comprise the form.
* @param $form_state
* A keyed array containing the current state of the form.
*/
function nico_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL) {
// Work-around for a core bug affecting admin themes. See issue #943212.
if (isset($form_id)) {
return;
}

// Create the form using Forms API: http://api.drupal.org/api/7

/* -- Delete this line if you want to use this setting
$form['nico_example'] = array(
'#type' => 'checkbox',
'#title' => t('nico sample setting'),
'#default_value' => theme_get_setting('nico_example'),
'#description' => t("This option doesn't do anything; it's just an example."),
);
// */

// Remove some of the base theme's settings.
/* -- Delete this line if you want to turn off this setting.
unset($form['themedev']['zen_wireframes']); // We don't need to toggle wireframes on this site.
// */

// We are editing the $form in place, so we don't need to return anything.
}

Comments

johnalbin’s picture

The change you made to the .info file is sufficient to make the sub-theme appear on your site. Not sure what is going on. :-\

johnalbin’s picture

Status: Active » Closed (won't fix)