First off, I'd like to apologize for putting up such a common ticket, especially when I know that 99% of the time its at the fault of the user. I got a custom node template file to work, but for some reason its ignoring my custom page template. I do have a copy of the original "page.tpl.php" in the same directory as the custom template file. I've also recognized that in D7 I need to use two hyphens "--" instead of one. Still no dice.
The machine name of the content type is "news_update" so the name of the template file I have is "page--news_update.tpl.php".
I've also flushed the theme catch every time I reload the page to see if its working. But haven't seen anything yet. Any guidance would be greatly appreciated.
Thanks.
Comments
Comment #1
echoz commentedIn D7 you no longer need to have a copy of the original tpl file in your theme folder along with your custom one. Your file name is the issue, the double worded content type should be using a single hyphen rather than the underscore, page--news-update.tpl.php.
Reference:
Core templates and suggestions
Drupal 7 Template Suggestions
Comment #2
digitalclover commentedMy apologies once again, but its still not showing up. I renamed the document as "page--news-update.tpl.php" but its still not loading under that content type. I've even tried. I flushed the theme cache, as well as the browser cache before reloading the page.
Comment #3
echoz commentedTo clarify, if you want to effect just how the content type’s node is rendered, you can use node.tpl.php which does have node--type.tpl.php as a default template suggestion. Correction from what I wrote previously, for page.tpl.php the default suggestions do not include content type, but use path. Drupal 7 Template Suggestions explains this. That page links to Working with template suggestions which shows how to make custom suggestions.
I avoid having additional page templates because edits to page.tpl.php would then require editing all. Depending on what you want to do, I prefer to use body classes to feed different css to pages.
Comment #4
johnalbinGreat tips, Elly! Thanks for helping out. :-)