Hello,
Iam having trouble with adding a region to the dan theme.
I have used the regions[abc] = abc line of code to add the region to the info file.
Add in the page.tpl.php file in the templates folder I added this
if ($abc):

print render($page['abc']);

endif;

The block shows up on the blocks page, but on the block region demonstration page of the theme(dan), the region doesn't show up.
And when I add a block to the region the block doesn't show on the website (I added the who's online block to the region).

On the website I get this error:
Notice: Undefined variable: abc in include() (line 106 of .../themes/dan/templates/page.tpl.php).

Thank you.
I will appreciate your help ...

Comments

JosefFriedrich’s picture

I believe you should write:

 if ($page['abc']): 

or better

 if (!empty($page['abc'])): 
JosefFriedrich’s picture

If you want to use the $abc variable directly, you have to put some lines to the template.php.

/**
 * Preprocessor for page.tpl.php template file.
 */
function dan_preprocess_page(&$variables, $hook) {

  $page = $variables['page'];

  $variables['abc']  = render($page['abc']);

}
AllanTheDream’s picture

... thank you Josef, I added that PHP code to the template.php and the regions now show up on the website.
Thank you, great help.

JosefFriedrich’s picture

Status: Active » Fixed
JosefFriedrich’s picture

Status: Fixed » Closed (fixed)