I've just started my Drupal 7 Zen theming and experience a problem.
Using Drupal 7.0, Zen 7.x-3.x-dev.

I want to have a custom front page in my subtheme.
What I did after creating and activating my subtheme is

  1. copy the sites/MYSITE/themes/MYTHEME/page.tpl.php to page--front.tpl.php and applied my changes and cleared the cache

    » didn't work (devel themer says that my front page is still rendered by sites/MYSITEl/themes/MYTHEME/templates/page.tpl.php)

  2. copy sites/MYSITE/themes/MYTHEME/page--front.tpl.php to sites/all/themes/zen/page--front.tpl.php

    » didn't work

  3. rename both page--front.tpl.php files to page__front.tpl.php, since devel themer gives the following suggestions:

    Candidate template files:
    page__front < page__node__7 < page__node__% < page__node < sites/MYSITE/themes/MYTHEME/templates/page.tpl.php

    (Is it really page__front instead of page--front?)

    » didn't work

Do You know how to make my subtheme use its page--front.tpl.php?

Comments

brainiac’s picture

Did you clear the cache after copying the page--front.tpl.php?

Edit: Sorry didnt read your Post carefully enough

dajpanspokoj’s picture

It must have been some caching problem - after another browser restart it's worked fine.

wheelercreek’s picture

I seem to be having the same problem. I've tried page--front.tpl.php, and page__front.tpl.php, and cleared caches many times. No effect. Switching back to default theme to see if it works without the Zen theme.

wheelercreek’s picture

This looks like a Zen theme issue. I just started creating a new custom theme, and page--front.tpl.php works fine.

dajpanspokoj’s picture

I've come across the issue when overriding theme output.
For some time theme system either looked for template in Zen folder (instead of the subtheme's folder) or used block.tpl.php from subtheme's folder instead of block--block--1.tpl.php. It's automagically fixed after a couple of hours and no apparent action.

If I come experience it once more I'll assemble a precise description and post an issue.

erode’s picture

Bartik is also doing it. I can't quite figure out how to get it to recognize it. Neither --, __, or any combination of those seem to work.

rantebi’s picture

Have you tried putting both page.tpl.php and page--front.tpl.php in your sub-theme templates folder.

It works for me.

robertb-1’s picture

I came across this somewhere, can't remember where. It said that Drupal 7 does not let you theme a page by content type unless you add the following to your theme's template.php file:

function themename_preprocess_page(&$vars, $hook) {
  if (isset($vars['node'])) {
  // If the node type is "blog" the template suggestion will be "page--blog.tpl.php".
   $vars['theme_hook_suggestions'][] = 'page__'. str_replace('_', '--', $vars['node']->type);
  }
}

where themename needs to be replaced with the name of your theme. There should then be no need to copy page.tpl.php into your theme directory (except to modify it and rename it page--xxxxx.tpl.php).

Jeff Burnz’s picture

What cache are you clearing exactly, some people think they have to clear their browser cache (no idea why), you have clear the theme registry cache - do this at /admin/config/development/performance, or install the Admin menu module and use the handy drop list, or install the Devel module and set the theme registry to rebuild on every page load.

BTW peeps - its page--front.tpl.php.

Snapycode’s picture

You are absolutely right Jeff. This issue is mainly generated for not clearing drupal cache properly.
So people please clear your drupal cache[not your browser cache] and try it again.

metakel’s picture

I've found that if I override the page--front.tpl.php in my subtheme, my Drupal 7.7 does not recognise it even I drush cc -> all cache. But it works after I click the "Configuration -> performance -> clear all cache".