I have tried everything I can think of, and can't seem to get Drupal to recognize my custom page.tpl.php. I have followed all the instructions to the letter and created a custom sub-theme to the zen theme using starterkit. When I try to copy the page.tpl.php file and place it in my custom sub-theme folder, drupal will not recognize it. I tried clearing the cache, along with a lot of other things. I also experimented with enabling the zen-classic theme, and seeing if drupal would recognize the page.tpl.php in that sub-theme. No such luck. Help please!

When I edit the main page.tpl.php in the system folder, it makes the changes I want. However, I know that's bad practice for when I want to update, so I need to figure this out.

Comments

traceelements’s picture

Assigned: traceelements » Unassigned
malphas’s picture

I had the same problem, I threw away the standard themes (yoursite/themes), putting those back solved the problem for me.

Hope this helps for you as well

*edit: I threw away the engine folder in the standard themes folder, thats why stuff didn't work anymore *

Jeff Burnz’s picture

If you are using a template suggestion you need both page.tpl.php and the template suggestion (page-[suggestion].tpl.php) in the same directory.

traceelements’s picture

Status: Active » Closed (fixed)

Thanks for the suggestions. Unfortunately, I think the issue has something to do with the Zen theme, because when I created a custom Garland-based theme, the page.tpl.php is recognized. I think I'm just going to scratch the whole Zen theme, because I've had multiple issues with it.

johnalbin’s picture

Priority: Critical » Normal
Status: Closed (fixed) » Postponed (maintainer needs more info)

Rebekah,

Drupal 6's Theme Registry stores cached data on the available theming hooks and how to handle them. Whenever you add a template file or add a theme override or preprocess function to your template.php, it's important to rebuild the theme registry.

On the "Administer > Site configuration > Performance" page, click on the "Clear cached data" button.

Also, if you modify the .info file, you must visit admin/build/themes for the changes to take effect.

That is the standard way that Drupal sub-themes work. Its not Zen-specific. And I'm curious what your “multiple issues” are.

traceelements’s picture

JohnAlbin,

Thank you for your reply. I did clear the cache every time I made changes, so that wasn't the issue.

Also, when you say here: "Also, if you modify the .info file, you must visit admin/build/themes for the changes to take effect.", what exactly do you mean by that? Do I have to do something specific when I go to the themes page, like de-activate, and then re-activate it? It doesn't seem like just visiting the page would do anything, but I'm not expert, so...I appreciate your help.

My issues with the Zen theme were as follows:

1) Error with the FCKEditor when visiting pages that utilized the editor.

2) Error in on the "themes" page in the admin

3) Error when I clicked "configure" for the custom theme

4) Not able to get drupal to recognize .tpl.php pages (as mentioned above).

I carefully went over the theme instructions for a zen sub-theme MULTIPLE times, and re-checked everything carefully to make sure I had followed the provided instructions to the letter. Eventually, I just gave up on a zen sub-theme when I realized if I switched to a garland-based theme, all of these issues went away. Another thing to mention about the zen theme, is that the instructions for creating a custom sub-theme that come with zen are outdated, and so a bit of interpretation is necessary (for example, there is no zen/zen/ sub-folder anymore).

onejam’s picture

Everything for me works fine. But i do have the issue where it does not recognize .tpl.php pages. For example, if node/1 is /welcome page then

adding something like page-node-1.tpl.php works but not page-welcome.tpl.php

Any idea? i've cleared cached and all the other stuff mentioned but to no avail?

Jeff Burnz’s picture

@#7

The suggestions... ... are based on the internal path of the current page. Do not confuse the internal path to path aliases which are not accounted for. Keep in mind that the commonly used Path auto module works its magic through path aliases. http://drupal.org/node/190815

Hope this will help ;) http://drupal.org/node/139766

onejam’s picture

Thanks, will try those code snippet.

akalata’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing this old issue as because it appears to have been solved to satisfaction.

cookiesunshinex’s picture

#3 fixed the issue for me.

I had copied node.tpl.php to my sub-theme and then renamed it to node-mycustomnamehere.tpl.php and did not see the customizations that I had made in node-mycustomnamehere.tpl.php when viewing the nodes of that type in the browser.

When I copied node.tpl.php from zen to my subtheme folder, and flushed the cache, it worked perfect.

Summary - you need files in the directory such as per below:

subtheme\node.tpl.php
subtheme\node-mycustomnamehere.tpl.php

zen\node.tpl.php

Thanks!!!