Drupal 6.2, 6.x-1.0-beta1

At the Admin > Site building > Blocks screen I see 4 Regions displayed:
- header
- left sidebar
- right sidebar
- footer

..but the drop-down menu to assign Blocks to Regions has additional options:
- navigation bar
- content top
- content bottom
- closure

I have tried placing content into the additional regions that I cannot see, but nothing shows up.

For example, I changed the location of the "Powered by Drupal" Block from the "footer" Region (where it was visible) to the "content top" Region - but the only change in the page was I could no longer see the "Powered by Drupal" icon. I tried several different changes, but nothing added to the additional Regions was ever visible.

How can I "see" where these additional Regions are?

Shouldn't they appear when content is added to them?

Comments

marcvangend’s picture

It sounds as if there is some code missing in your page.tpl.php, for instance:

<?php print $closure ?>

would print the contents of the closure region. If the code for printing the blocks is present, check if it is inside an if-statement which always evaluates to 'false'. Also, check if the region variables (like $closure) in page.tpl.php match the regions as declared in your theme's .info file.

non’s picture

- still not working as I expect it should.

The code seems to be complete- here is the last few lines of the page.tpl.php file for an example: (this is the default code that came with the "Zen" theme)

if ($closure_region):

print $closure_region;

endif;

print $closure;


And here is the regions that are defined in the .info file: (I did rename this file and add one region "verytop")

regions[left] = left sidebar
regions[right] = right sidebar
regions[navbar] = navigation bar
regions[content_top] = content top
regions[content_bottom] = content bottom
regions[header] = header
regions[footer] = footer
regions[closure_region] = closure
regions[verytop] = very top

Still- out of all those regions, only the standard four are seen on the "Blocks" page. Even when I assign content (like Powered by Drupal) to regions not seen, they still do not show up.

So I'm stuck at the moment! Can't wait to get something going further than basic placement and CSS..

Thanks for the help Marc.

non’s picture

The above code snip is not correct- I will use the "code" tag below.


  <?php if ($closure_region): ?>
    <div id="closure-blocks" class="region region-closure"><?php print $closure_region; ?></div>
  <?php endif; ?>

  <?php print $closure; ?>

</body>
</html>

Wayne_Luke’s picture

The actual region is $region_closure. The word "closure" is what is shown in the Blocks management screen. There should be no information to print for $closure.

As for the .info file. As far as I am aware, this needs to be the same name as your theme and you can have only one per theme.

non’s picture

Still a little confused though- when I do assign a Block to the "closure" region, shouldn't I see it appear on the screen?

For instance, I assign the "Powered by Drupal" Block to the "closure" Region - wouldn't the page.tpl.php file be updated to reflect this?

marcvangend’s picture

No, page.tpl.php is not updated. In page.tpl.php you define where the region is put in your html structure. In the back-end, you assign blocks to the regions. This information is stored in the database. The actual content is only put in the regions when a visitor loads a page. At that point, Drupal dynamically adds the blocks to the regions.

So: when you assign a block to a region, page.tpl.php does not change. However, when you load your site in your browser, the assigned blocks should appear, of course. If it doesn't, you can:
- check if the regions are defined properly in the .info file
- check if the right code is used in page.tpl.php
- check if the region code in page.tpl.php is not inside an if-statement which evaluates to 'false'
- check if the block itself works (try if it does show up when assigned to other regions)

I don't know about Drupal 6, but in Drupal 5, when you visit the block administration page, all available regions are marked with a yellow bar. I imagine D6 does that too. If you see a yellow bar in the closure region, the problem is probably in your block. If you don't see a yellow bar, the problem is probably in page.tpl.php and yourtheme.info.

hollybeary’s picture

Maybe some styling would help? If the code looks to be correct in your tpl.php file then perhaps you could try styling the regions with some width, height or float properties to get them to show. I've had this problem before where regions I made weren't showing up, they just needed some styling. I think sometimes, maybe just with certain browsers, divs don't show up unless they have some styling properties assigned to them. Hope that helps!