i'm trying to get the D7's region overrides working.

if in my (fusion) subtheme's 'page--front.tpl.php' I have

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

, and in 'region--header.tpl.php' I simply add

 <div>BLAH BLAH</div>

i'd expect to see "BLAH BLAH" displayed on my front page. atm, it's not.

a similar addition to a copy of 'region.tpl.php' in my subtheme, otoh, DOES get changes picked up & displayed.

noting in html.tpl.php

tho :-/ add'ns to region--page_top.tpl.php DO get picked up, but additions to region--page.tpl.php &/or region--page_bottom.tpl.php do NOT ... even tho html.tpl.php contains:

 print $page_top;
 print $page;
 print $page_bottom;

if I add something to 'region--page_top.tpl.php', changes ARE picked up & displayed. but,
if I add same changes to 'region--page_bottom.tpl.php', changes ARE *NOT* picked up & displayed.

so, not exactly consistent behavior

@ region.tpl.php, works
@ region--header.tpl.php FAILS
@ region--page_top.tpl.php works
@ region--page_bottom.tpl.php FAILS

What needs to be done to get them all working?

Comments

_________’s picture

fyi,

@ http://api.drupal.org/api/drupal/includes--theme.inc/function/template_p... suggests

"... Uses the region name to generate a template file suggestions ..."

...
$variables['theme_hook_suggestions'][] = 'region__' . $variables['region'];
...

which would imply (verified @ http://drupal.org/node/1200222) that one should use 'region__(region_name).tpl.php' for overrides.

but, i've now tried each of:

region-(region_name).tpl.php
region--(region_name).tpl.php
region_(region_name).tpl.php
region__(region_name).tpl.php

Only some, not all, for the second case, 'region--(region_name).tpl.php' are working.

roper.’s picture

Hate to ask the obvious, but are you clearing the theme registry after you add your new templates?

_________’s picture

yes. set to clear/rebuild after each page load.

also did 'drush cc all'; no help.

nevets’s picture

Your theme folder needs a region.tpl.php for any of region--(region_name).tpl.php to work and region names need to be in the theme's .info file.

_________’s picture

> Your theme folder needs a region.tpl.php for any of region--(region_name).tpl.php to work

yes, as documented. it's 'in there'.

> and region names need to be in the theme's .info file.

of course. they're declared in the .info.

ls -1 ./sites/www.mysite.com/themes/my_fusion/templates/*region*
 region--header.tpl.php
 region--page_top.tpl.php
 region--page_bottom.tpl.php
 region.tpl.php

grep ^region ./sites/www.mysite.com/themes/my_fusion/my_fusion.info
 regions[sidebar_first]     = Sidebar first
 regions[sidebar_second]    = Sidebar second
 regions[header_top]        = Header top
 regions[header]            = Header
 regions[main_menu]         = Main menu
 regions[preface_top]       = Preface top
 regions[preface_bottom]    = Preface bottom
 regions[content]           = Content
 regions[postscript_top]    = Postscript top
 regions[postscript_bottom] = Postscript bottom
 regions[footer]            = Footer
 regions[node_top]          = Node top
 regions[node_bottom]       = Node bottom
 regions[help]              = Help
 regions[page_top]          = Page top
 regions[page_bottom]       = Page bottom

in any case, the problem, as reported, persists.