Hello,

I am having a few problems overriding the front page template.

So create a template called page--front.tpl.php in my sub theme template directory. That didn't work.

So I added a theme_hook_suggestions in my mytheme_preprocess_html() as shown:

if($variables['is_front']){
      array_unshift($variables['theme_hook_suggestions'], 'page__front');
  }

So that worked but I can't seem to use the render function: -

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

the error I get is: -

Fatal error: Only variables can be passed by reference.

But it allows me to: -

print $page;

Any Ideas?

Thanks in Advance

Comments

fubhy’s picture

Category: bug » support
Status: Active » Fixed

That sounds like you are using a layout? Layouts are not page.tpl.php (and, thus, do not support page--front.tpl.php)... When you added that theme hook suggestion you basically just added it manually even though it was never going to go to page.tpl.php anyways... Disable the layout extension if you want to do this with plain page.tpl.php (which is fine) or, if you want to keep using layouts, switch the layout for the front page using hook_omega_layout_alter() or the context_omega module.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.