Hello,
Under a Drupal 6.10 with relatively recent releases of CCK, Views, Date, and Calendar, I am having a strange issue with my theme, which is a subtheme of Zen.
Essentially, node templates (e.g., node-story.tpl.php) are not being recognized in my theme directory by CCK/Views. I have, for example, a "Story" content type which I want to theme with node-story.tpl.php. Having researched this issue in the forums, I made sure that node.tpl.php AND node-story.tpl.php existed in my subtheme directory. The Devel module picked up node-story.tpl.php as a "Candidate Template," but the template is simply not being used.
1. I have ensured that the base template (node.tpl.php) exists and is in both the Zen and the subtheme directory.
2. I have ensured that the story template (node-story.tpl.php) exists and is both the Zen and the subtheme directory.
3. I have cleared the theme registry repeatedly.
4. I have used Devel to clear all caches repeatedly.
5. I have cleared the Views cache.
What else can I possibly do?
Thanks in advance
Comments
Strange, you really did
Strange, you really did everything right... are you overriding preprocess functions in your template.php? If so, please post the code.
If you make a change in node.tpl.php, do you see the effect, or doesn't that work either?
Thank you for your kind
Thank you for your kind responses.
Firstly, I am not doing too much on the preprocess side in template.php. Here is the file just in case you see something that might be causing this:
Secondly, when I make a change to node.tpl.php in either Zen or the subtheme, nothing happens. It appears to be using the only other node.tpl.php, which is in /modules/views/themes! It's completely ignoring node templates in my subtheme, but it does recognize my standard Views templates (e.g., views-view-field.tpl.php, etc.) in the subtheme. Just not node templates...
How odd... I don't know how to troubleshoot this.
Maybe you can put the
Maybe you can put the following line inside agape_preprocess_node and post back the result:
Sorry I found this issue as
Sorry I found this issue as I'm stuck with Drupal not using my subtheme's node.tpl.php (or node-[content_type].tpl.php) files.
Mine says:
You say "for example I have
You say "for example I have story", is it actually story or a custom content type, I ask because you must use the machine readable name, say for example you have a content type call "news story" the node tpl will be node-news_story.tpl.php, note the underscore.
You dont need the template suggestion in Zen core theme, just the subtheme.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Thanks for your response. It
Thanks for your response. It is an actual story content type... I am using the right name. As I said, even the Devel module recognizes "node-story.tpl.php" as a candidate for this exact content type output.
As for the template suggestion, I placed it in Zen in the hope that it would work, but it didn't help, so my suggestions are now only in the subtheme.
May be a silly question but
May be a silly question but under Administer › Site configuration › Administration theme any chance you have "Use administration theme for content editing" checked? (If you do the node-story.tpl.php would have to be part of the administrative theme).
this may be a silly question
this may be a silly question but where did you create your node-story.tpl.php files and how did you upload it
sometimes i catch myself after saving a copy of my node.tpl.php , i forget to add the php so it gets saved as node.tpl , without the php it doesn't work
One annoying habit I have is
One annoying habit I have is to save a copy in another folder that its higher up the directory structure, Drupal finds it first and never sees my suggestion in a lower down directory.... that ones had me scratching my head for a few minutes more that once :/
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Another thing that can make
Another thing that can make you scratch your head: wrong permission that doesn't allow read to the node-story.tpl.php
--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com
I have exactly the same
I have exactly the same issue, before find your post I've tried things you said, ensure that node....tpl.php is in the right folder etc. The template ignores all node types templates
Tried switch to Garland theme, not fixed
Same trouble with Garland theme, it's a core/some module issue?
The only core issue is that
The only core issue is that you must have the node.tpl.php and node-[suggestion].tpl.php files in the same directory, not just in the same theme, in the exact same directory within the theme (if you organizing templates in sub-folders).
You guys need to check everything such as file name spelling and use the Themer module (in Devel) to double check you have the suggestion naming correct, and clear the theme registry the easy way to achieve this is use the Devel module or the Admin menu module which gives you a link to clear the registry.
I am reiterating these basics because in the hundreds of themes I have built I have never had the suggestions system fail me when I was doing everything right. Occasionally I get naming conventions for content field templates wrong and have to double check with Themer.
So, if you have done everything right and its still not working then I would be wondering what is going inside your theme or what modules you have installed, its entirely possible to mess the suggestions system up in template.php or a module.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.