I wanted to copy the garland theme with different names so that I could try different color and styles. But the new themes can only see the default regions, but not the extra ones diffined in the template.php I name the function in template.php with newtheme_regions and the extra regions are same for all themes . I don't know where I could be going wrong.. any thing else I should take care.. I thought this should be straight forward...

Comments

roopletheme’s picture

If you can post the code from your template.php file, I bet you'll find some help.

www.roopletheme.com

Drupal_’s picture

the template.php is pretty much the standard except for the regions. It seems to be working in the default garland theme. But the regions don't get shown for other copied themes. All the content in those regions goes to the left sidebar for some unknown reason!! Here's the template.php if it helps.

thanks

<?php
/**
 * Sets the body-tag class attribute.
 *
 * Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
 */
function phptemplate_body_class($sidebar_left, $sidebar_right) {
  if ($sidebar_left != '' && $sidebar_right != '') {
    $class = 'sidebars';
  }
  else {
    if ($sidebar_left != '') {
      $class = 'sidebar-left';
    }
    if ($sidebar_right != '') {
      $class = 'sidebar-right';
    }
  }

  if (isset($class)) {
    print ' class="'. $class .'"';
  }
}

/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return a string containing the breadcrumb output.
 */
function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
/*    return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>'; */
    return '<div class="new_breadcrumb">'. implode(' › ', $breadcrumb) .'</div>'; 

  }
}

/**
 * Allow themable wrapping of all comments.
 */
function phptemplate_comment_wrapper($content, $type = null) {
  static $node_type;
  if (isset($type)) $node_type = $type;

  if (!$content || $node_type == 'forum') {
    return '<div id="comments">'. $content . '</div>';
  }
  else {
    return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
  }
}

/**
 * Override or insert PHPTemplate variables into the templates.
 */
function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {

    if ($secondary = menu_secondary_local_tasks()) {
      $output = '<span class="clear"></span>';
      $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
      $vars['tabs2'] = $output;
    }

    // Hook into color.module
    if (module_exists('color')) {
      _color_page_alter($vars);
    }
    return $vars;
  }
  return array();
}

/**
 * Returns the rendered local tasks. The default implementation renders
 * them as tabs.
 *
 * @ingroup themeable
 */
function phptemplate_menu_local_tasks() {
  $output = '';

  if ($primary = menu_primary_local_tasks()) {
    $output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
  }

  return $output;
}


/*
 * added for new regions
 */

function newtheme_regions() {
  return array(
    'infocomment' => t('infocomment'),
    'above_content_l' => t('above content left'),
    'above_content_r' => t('above content right'),
    'above_content' => t('above content'),
    'below_content' => t('below content'),
    'left' => t('left sidebar'),
    'right' => t('right sidebar'),
    'content' => t('content'),
    'header' => t('header'),
    'footer' => t('footer')
  );
}

Drupal_’s picture

Can we have extra regions defined for multiple active themes?? I tried this with garland, but doesn't look like it can be done.

----------------------------------------
PopularSikh - for the sikh inside you !!

dvessel’s picture

When adding a new theme, you must set the regions for that new theme. Drupal has no clue that your new theme is a copy of Garland so it'll push all the blocks to the first item in yourtheme_regions().

And yes, each active theme can have their own blocks regions.

Drupal_’s picture

But it is not working.. not sure why..

----------------------------------------
PopularSikh - for the sikh inside you !!

dooglet’s picture

removed: epic necro o.O, sorry!