By s.w.coughlan on
I've created three custom regions in my .info file:
regions[left-links] = Left Links
regions[centre-video] = Centre Video
regions[right-news] = Right News
I've inserted the correct code into the div's that I want to make into regions:
<?php if ($right-news): ?>
<?php print $right-news ?>
<?php endif; ?>
blah blah... you get the idea! The problem is that when I assign a block to any of these three regions, nothing happens. I have a sneaking suspicion this may have something to do with the fact that I'm using a page-front.tpl.php file, this is where the regions are defined.
When regions are defined in .info, are they only defined for page.tpl.php?
If so is there anything I can do to get these 3 regions to work? Hair pulling is about to commence...
Comments
Hi Steve, I was just doing
Hi Steve,
I was just doing something similar, did you add a preprocess_node function to your template.php file as well as the above?
For a (hopefully) complete custom region write-up for D6, See:
http://drupal.org/node/208869#comment-2370828
Hope that helps,
Michael
Michael... thanks for the
Michael... thanks for the quick response.
I did try adding the following to my template.php file
I found it in the forum somewhere and hoped it might work. It didn't. I've just read over your write-up, do u think this would work for my issue? Or would I need to make adjustments seeing as I'm not trying to define a region in node.tpl.php but in page-front.tpl.php?
I'm a designer at heart... all this code gives me headaches!
The names should not use
The names should not use dashes (-) since that is not a legal character in a php variable.
BOOM! That did the
BOOM! That did the trick...
Thank you nevets.... and thank you Michael. Much appreciated.