It looks like the correct way to override any page template in a subtheme is to first copy the Zen core page.tpl.php into the subtheme, then duplicate that to page-front.tpl.php (or whatever), and make the modifications in there.

I'd love to be able to leave the core page.tpl.php where it belongs, so I have one less thing to remember when upgrading Zen. I haven't looked into this in much detail, but is this a reasonable expectation that I should be, say, trying to write a patch for?

Comments

zanlus’s picture

To solve this problem, can't you just simlink (ln -s) to the page.tpl.php in the zen core? Then you don't need an additional module and you don't need to keep updating your theme?

akalata’s picture

Component: Miscellaneous » Documentation
Status: Active » Needs work
wheelercreek’s picture

I wasn't able to get page--front.tpl.php to work with zen-7.x-3.x-dev. Cleared cache many times, doesn't seem to work? The only templates I have in my sub theme template folder are page.tpl.php,and page--front.tpl.php.

Next I created my own custom theme - not a sub theme of Zen, and it's working fine there.

dhaws’s picture

I had this problem and solved it by adding page.tpl.php to my sub-theme.

In other words, I copied page.tpl.php from /zen/templates to /subtheme/templates. Then I copied /subtheme/templates/page.tpl.php to /subtheme/templates/page-front.tpl.php. I think the key is having both the page.tpl.php and the page-front.tpl.php in your /subtheme/templates directory.

akalata’s picture

Version: 6.x-1.0 » 7.x-3.x-dev
Status: Needs work » Active

@dhaws: The need to duplicate the base template in the same directory as a custom template (for example, needing page.tpl.php in order for page-front.tpl.php to work) is a bug in core.

@wheelercreek: Any luck? It sounds like what you're doing should be working...

johnalbin’s picture

The need to duplicate the base template in the same directory as a custom template (for example, needing page.tpl.php in order for page-front.tpl.php to work) is a bug in core.

Yes, its a bug in Drupal core 6.x. But it is fixed in Drupal core 7.x.

beckyjohnson’s picture

I have both templates in my template folder and I'm using the D7 theme and I can't get the page-front.tpl.php to over write anything.... see this:

http://drupal.org/node/1090504

Rebecca

n8tron’s picture

Did you try page--front.tpl.php ?

beckyjohnson’s picture

No. I didn't know that was an option. I will try it now.

beckyjohnson’s picture

Ok Page--front.tpl.php worked! I didn't realize I had to do this because the template in the folder had only one dash and I assumed that that was correct.

johnalbin’s picture

Status: Active » Fixed

Marking this fixed. The original request was against D6 which is a known core bug. And the new D7 page--front.tpl.php does not require that your sub-theme also have a page.tpl.php.

Status: Fixed » Closed (fixed)

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