Hi all,

I have read this post (http://drupal.org/node/29139) and created 2 custom regions using the code below in my template.php file:

<?php
function baron_regions() {
  return array(
    'right' => t('right sidebar'),
    'content' => t('content'),
    'header' => t('header'),
    'footer' => t('footer'),
    'subcontent-a' => t('subcontent-a'),
    'subcontent-b' => t('subcontent-b')
  );
}
?>

I have included the new custom regions in my page.tpl.php file:

<div id="subcontent-a">hello<?php print $subcontent-a; ?></div>
<div id="subcontent-b">world<?php print $subcontent-b; ?></div>

When I go to administer -> blocks, the new regions are available in the drop-down menus. However!

  1. My regions do not show up on the administer -> blocks page like the other regions do (a shaded area saying for example: 'right sidebar'). There are no shaded areas saying 'subcontent-a' or 'subcontent-b' to show where they are on the page, as I assumed there would be.
  2. When I assign a block to the region, it does not appear.

Can anyone suggest where I have gone wrong? I can't seem to find it. I'm using Drupal 4.7.4.

Thanks for any help!

Comments

baronmunchowsen’s picture

Okay - 2 seconds after I posted the above it came to me:

For some reason I thought you could stick a hyphen in variable names! Where did I come up with that?!!!???

Too many late nights...

I changed all of

$subcontent-a

to

$subcontenta

and it's all good.

I am a plonker.

Kids, don't do drugs. They mess you up.