Download & Extend

Overriding page-front.tpl.php while leaving Zen core alone

Project:Zen
Version:7.x-3.x-dev
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

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?

#2

Component:Miscellaneous» Documentation
Status:active» needs work

#3

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.

#4

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.

#5

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...

#6

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.

#7

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

#8

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

#9

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

#10

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.

#11

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.

#12

Status:fixed» closed (fixed)

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

nobody click here