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
Comment #1
traceelements commentedComment #2
malphas commentedI 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 *
Comment #3
Jeff Burnz commentedIf you are using a template suggestion you need both page.tpl.php and the template suggestion (page-[suggestion].tpl.php) in the same directory.
Comment #4
traceelements commentedThanks 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.
Comment #5
johnalbinRebekah,
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.
Comment #6
traceelements commentedJohnAlbin,
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).
Comment #7
onejam commentedEverything 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?
Comment #8
Jeff Burnz commented@#7
Hope this will help ;) http://drupal.org/node/139766
Comment #9
onejam commentedThanks, will try those code snippet.
Comment #10
akalata commentedClosing this old issue as because it appears to have been solved to satisfaction.
Comment #11
cookiesunshinex commented#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!!!