Add custom region sub-theme Drupal 7

Events happening in the community are now at Drupal community events on www.drupal.org.
freshness's picture

If I bother you because I'am using the wrong forum, please forward me to the right one.

Hi, at first, let me mention that I'am new to Drupal but have experience in web. I've tried to look for a solution to my problem, both via Google and drupal.org. No success.

In Drupal 7, I try to add a new region. The result: Undefined variable: foo even though I have defined foo in the info-file with the regions[foo] = Foo

As I understand it, it should be sufficient to make the variable $foo is available in page.tpl.php? The foo region appears selectable in the Block administrator section.

Thanks for taking the time.

Comments

When adding your foo region

rhache's picture

When adding your foo region to the tpl, you have to use the following syntax:

<?php print render($page['foo']); ?>

You cannot simply use the following, like in Drupal 6, because the region is not rendered yet.

<?php print $foo; ?>

Cheers

I should point out that in

rhache's picture

I should point out that in the future, the Theme development forum would be the ideal place for this type of question.

http://drupal.org/forum/3

Thanks.

freshness's picture

Thanks, it did work. Im going for http://drupal.org/forum/3 next time.

Theme development

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week