Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ThePiano.SG on
I'm using Drupal 6.4.
I applied Theme1, which contains a node-forum.tpl.php. Drupal does discover this file, and use it.
I applied Theme2, which also contains a node-forum.tpl.php. Drupal does NOT discover this file at all.
I tried with node-page.tpl.php as well. The same results. Theme2's node-page isn't discovered by Drupal.
Is there any setting in Theme2 which prevents Drupal from discovering those files?
I do understand that it is in Drupal's core to discover node-[contenttype].tpl.php.
Thanks for helping me.
Comments
Did you clear the theme registry?
Did you clear the theme registry? http://drupal.org/node/173880#theme-registry
Yes I did.
Yes I did.
By choosing a new theme, I realise, also will make Drupal discover the template files.
For additional information, Theme2 has a template.php which doesn't have any _preprocess_ hook on 'node' to override any node suggestion template files.
----------
*UPDATE*
----------
I solved the problem.
I think this should go to the handbook of Theming.
I do not know if it is an obvious, but it is indeed a plausible pitfall.
All I did was to add a node.tpl.php file to Theme2's directory.
It seems like Drupal only discovers the rest of node-[something].tpl.php only when the default node.tpl.php is there?
This made me lost hours of effort.
Hope it helps anyone.
>> It seems like Drupal only
>> It seems like Drupal only discovers the rest of node-[something].tpl.php only when the default node.tpl.php is there?
Yep, that's very true.
I've also come across this problem recently... should definitely be in the handbook.
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials
---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com
Thanks, that's definately
Thanks, that's definately good to know. For future reference: what exactly did you put in your node.tpl.php? You can't leave it blank I suppose...
I just use the default
I just use the default contents of Garland's node.tpl.php. Modules usually have .tpl files in their module folder, so you should be able to use whatever is there.
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials
---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com
Just use the default node/node.tpl.php
I just copied the default module/node/node.tpl.php.
Because when nothing is discovered by Drupal in the theme directory, it falls back to that file.
This still appears to be the
This still appears to be the case .. I've updated the template page (http://drupal.org/node/190815) accordingly.
++Andy
Developing Drupal websites for Livelink New Media since 2008