Hey, Couz!
Me again with my non-coder issues :-)

I really want a banner above the header, how do I do this? I just realized the regions are not defined in the .info file as D6 themes are, so I'm really puzzled here.

Tried this in page,tpl.php:

<?php if (!empty($banner)): ?> 
	  <div class="span-24 last">
	  </div>
	  <?php endif; ?>

Didn't work... :-(

Besides, the search box isn't working either no matter I updated to beta2.

Thanks in advance!
Warm regards from sunny México!
:-)
José

Comments

Anonymous’s picture

Status: Active » Needs review

The search box works fine for me... did you remember to activate it in your theme settings ?
The regions are not set in the info file because it just uses the default drupal regions. To add new regions, you have to declare the default ones and add your custom one. And remember that when you change your info file, you have to refresh your theme cache by just submitting the theme page.

pepemty’s picture

Status: Needs review » Active

Oh, Couz...

I just find out that the header is what I want... I only moved it above the logo coding in page.tpl.php et voilà.

Anyway, for general knowledge, what's the correct way to create a new region?

Regards,
José

Edit:
You answered me while I was writing this :-)

Anonymous’s picture

Create a new region in Drupal 6

It is done in two steps. First you need to declare the region in the .info file, and then you need to assign it in your page.tpl.php.

To declare a region in the info file, for example a "content bottom" region, add this in your info file :

regions[content_bottom] = Content Bottom

The first value is the machine readable name of the region, and the second one is the human readable name, that will appear in the drop-downs on the block page.

Now that the region is declared, you have to specify where in the page the region should be. To do this, you just have to add the variable to the page, using the machine readable name you created, like this :

<?php echo $content_bottom; ?>

A good idea would be to only output the region if there is something inside it, so create a condition that check if there is something in the region before outputing it, like this :

<?php if ($content_bottom): ?>
  <?php echo $content_bottom; ?>
<?php endif; ?>

You can even add some markup around it (but inside the condition), to theme it easily :

<?php if ($content_bottom): ?>
  <div id="content-bottom">
    <?php echo $content_bottom; ?>
  </div>
<?php endif; ?>

There you go !

pepemty’s picture

Couz (tipping my cap),

Thank you! Now I have an extra region :-)

Warmest regards!
José

Anonymous’s picture

Assigned: Unassigned »
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.