I have a theme thats working great but I want to add a new block region so I can edit an area from within the admin / not having to open template files to alter.
In your templatename.info file you should have something like this
regions[left] = left sidebar regions[right] = right sidebar regions[content] = content regions[header] = header regions[footer] = footer
Then in your template files (page.tpl.php) these areas are printed out like this (For the left sidebar)
<?php if ($left): ?>
<?php print $left ?>
<?php endif; ?>
To add a region just add the line
regions[example] = example region
The left defines the region the right is just a description that will be seen from the admin area blocks.
Now in your page.tpl.php add
<?php if ($example): ?>
<?php print $example ?>
More information about formatting options
Replies
Drupal Regions
In your templatename.info file you should have something like this
regions[left] = left sidebar
regions[right] = right sidebar
regions[content] = content
regions[header] = header
regions[footer] = footer
Then in your template files (page.tpl.php) these areas are printed out like this (For the left sidebar)
<?phpif ($left):
?>
<?phpprint $left
?>
<?phpendif;
?>
To add a region just add the line
regions[example] = example region
The left defines the region the right is just a description that will be seen from the admin area blocks.
Now in your page.tpl.php add
<?phpif ($example):
?>
<?phpprint $example
?>
<?phpendif;
?>
Post new comment