Closed (fixed)
Project:
Austin Zen Sub Theme
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
28 May 2010 at 11:44 UTC
Updated:
22 Nov 2011 at 14:21 UTC
Tried this multiple times with different content types. Can't get node-content-type.tpl.php to be recognized, though I cleared caches. Wondered if this is a sub-theme issue. But there is a node.tpl.php file sitting in the austin theme root. Any ideas?
Joseph
Comments
Comment #1
j0e commentedI neglected to mention that I was able to override other template files, such as block.tpl.php; just isn't working with the node template.
Thanks,
Joseph
Comment #2
j0e commentedStrange, this did happen once before, suddenly it's working for one custom content type yet still not the other. I checked the usual suspects, name of the content type etc. it's all correct... again, caches are all cleared so that's not it either. I would rather it's a problem with the content type than the theme, but I still can't figure out what's causing the lack of recognition of the node-content-type.tpl.php file.
Comment #3
caroltron commentedI tested adding a new content type of "event" and added a tpl called node-event.tpl.php and did not experience any issues. Is it possible that you removed the node.tpl.php? In D6 it is required that you have the node.tpl.php in addition to the node-contenttype.tpl.php. (I believe that this has change, however, in D7). Not having node.tpl.php in your theme will cause any other node-type.tpl.php to be ignored.
What is the name of your tpl? I'd like to reproduce your steps if I can. thx.
Comment #4
caroltron commentedComment #5
caroltron commentedComment #6
j0e commentedThanks Colleen, I didn't remove any of the template files. The thing is now I can't reproduce it either: suddenly, it's working for all my content types, not sure why: I assume it's nothing wrong with the theme, so I'll chalk this one up to sheer mystery. I switched hosting providers, but that doesn't seem to be the reason. Anyway, thanks for looking into it. I appreciate it very much.
Comment #8
robato commentedThis is happening to me as well right now. I have an underscore in my content type name. Does anyone think that may be the problem?
Comment #9
alanpage commentedUnderscores in your content types are not converted to hyphens in the template suggestions for node templates (D6). In /includes/theme.inc the code uses the actual content type, but the comment suggests that underscores will be removed:
So a content type of my_content_type would produce a template suggestion of:
and not:
The Theme developer module (dependent on Devel, but a separate project now) showed me what the suggestions were for my node, despite what the Working with Template Suggestions (http://drupal.org/node/223440) doc page says: "Use hyphens instead of underscores for consistency." That should say, "unless your content type has an underscore in it."
Comment #10
Haren commentedThis is happening to me as well right now.
My content type has undescores - and i've all possible variations. (and yes i have other .tpl.php-files that works)