Hi Folks,

I can't seem to add regions. I've added this code into my template.php file:

function csiwireframe_regions() {
  return array(
       'left' => t('left sidebar'),
       'right' => t('right sidebar'),
       'content_top' => t('content top'),
       'content' => t('content'),
       'header' => t('header'),
       'footer' => t('footer')
  );
} 

And I've specified where 'content top' should appear in page.tpl.php:

    <div class="main-in">
    <?php print $breadcrumb ?>
    <h2><?php print $title ?></h2>
    <?php if ($tabs): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?>
    <?php print $content_top ?>
	<?php print $content ?>
    </div><!--main-in ends--> 
    </div><!--main ends-->

Is there anything I'm missing?

Thanks!

Comments

vm’s picture

what version of Drupal is in use ?

is the new region showing in the drop downs in adminsiter -> modules ?

any chance page caching could be the cause ?

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

add1sun’s picture

VeryMisunderstood meant Administer > Site building > Blocks

Lullabot loves you | Be a Ninja, join the Drupal Dojo

Drupalize.Me, The best Drupal training, available all the time, anywhere!

ArgentOfChange’s picture

Wow, thanks for the speedy response :)

I upgraded my installation to the latest version right before Drupal 6.0 was released (I forget the precise number).
The new region is NOT showing up in the administer>modules drop down menus.
I disabled my cache and its still not there....

Cheers!

ArgentOfChange’s picture

Err, yah I meant Administer » Site building » Blocks too :)

silverwing’s picture

This is interesting....

If you log in with a different browser, can you get the region to show up in whatever >> whatever >> blocks ?

If you add that region to another theme (and if that theme is the default) does it show up in the above?

~silverwing - don't know why I'm asking this, actually...

_____________________________________________
MisguidedThoughts | showcaseCMS

ArgentOfChange’s picture

Thanks for the suggestion, but I tried that and it didn't work either :(

jabba_29’s picture

I upgraded my installation to the latest version right before Drupal 6.0 was released

So, is that a RC v6 or version 5 still or even a 4x????

Shot in the dark, try changing

'content_top' => t('content top'),

to

'top_content' => t('top content'),

and change the variable name in page.tpl.php.

If you are using v6, your regions should be in your csiwireframe.info file

regions[left] = Left sidebar
regions[right] = Right sidebar
regions[header] = Header
regions[content_top] = Top content
regions[content] = Content
regions[footer] = Footer

Regards

Jamie

skiFFie: home of the accessibility module

ArgentOfChange’s picture

Sorry for being unspecific, but my version of Drupal is 5.x (most likely 5.7, the last version prior to 6.0 released as I had updated a week before 6.0 came out.)

I created a custom theme based on Zen. There were no mods to the template.php file apart from a bit of php that lets me display the teaser on aggregated feeds:

/**
 * Format an individual feed item for display in the block.
 *
 * @ingroup themeable
 */
function phptemplate_aggregator_block_item($item, $feed = 0) {
  global $user;
  // Display the external link to the item.
  $output .= '<a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n"; 
  // Display the feed teaser to the item.
  if ($item->description) {
    $output .= '<div class="feed-item-body">'. aggregator_filter_xss($item->description) ."</div>\n";
  }
  return $output;
}

BTW, I tried using top_content as well, same results. :(

Cheers and thanks!

artist.lupein’s picture

Everything you posted looks all right.

Stupid question - are you sure theme name is exactly csiwireframe? Check directory name and lower/upper case.

What happens when you delete some of the standard regions from _regions() function?

--
Lupein
Drupal themes - themeartists.com

ArgentOfChange’s picture

You may have hit it on the nail.
The folder containing my theme is called csiwireframe_.
Could the underscore be causing the problem? I thought that was part of best practice for creating custom themes?

Cheers!

artist.lupein’s picture

I think that's it. Why don't you try to rename the folder to csiwireframe? As an alternative - try naming callback csiwireframe__regions().
--
Lupein
Drupal themes - themeartists.com

TUc’s picture

I'm using 5.7 and have exactly the same problem.

In my template-file I have these regions defined:

function grant_regions() {
  return array(
    'left' => t('left sidebar'),
    'right' => t('right sidebar'),
    'navbar' => t('navigation bar'),
    'content_top' => t('content top'),
    'content_bottom' => t('content bottom'),
    'header' => t('header'),
    'footer' => t('footer'),
    'closure_region' => t('closure'),
  );
}

In my page-template, I can't use $left and $right. What's been making it even more strange is that using $left_sidebar actually works!

TUc

artist.lupein’s picture

For historic reasons, variables that output content of left, right and footer regions are called $left_sidebar, $right_sidebar and $footer_message.

Does not make much sense, but that is the way it is in Drupal 5. New Drupal 6 theme system fixed this.
--
Lupein
Drupal themes - themeartists.com

smallfoambirds’s picture

I've been using the Zen theme with several custom regions. Lately the regions haven't been showing up in the dropdown menus in the Blocks page. Although content that was previously assigned to the custom regions still displays in those regions, I'm unable to add blocks to these regions (because they aren't available anymore in the menus). The blocks table in my DB still reflects the correct regions.

I've tried completely deleting and reinstalling the theme from a backup; no luck. Modifying the template.php or page.tpl.php to add or remove additional regions has no effect. I am able to add regions to other themes.

I think this started when I used the domain access module to create new prefixed block tables for a subdomain that I'm using with a Zen subtheme. I've dropped all block tables from my DB, and imported old ones from backups, removed the subtheme, disabled the domain_theme module, with no luck.

I don't know what else would have changed. Where else should I be looking? Seems like Drupal is simply not seeing the template.php file in my Zen folder, because any changes I make to it don't appear on the site. The theme is correctly named, as is the "zen_regions" function; and like I said I'm able to add regions to other themes without a problem.

Thanks!