Search code examples
phpdrupal-6drupal-taxonomy

Can't access node-taxonomy.tpl.php through page-taxonomy-term.tpl in Drupal 6


I've been trying to customize taxonomy page template in my Drupal 6 site.

What I did was

  • created page-taxonomy-term.tpl.php
  • created node-taxonomy.tpl.php
  • Entered following code in template.php:

     function templateNAME_preprocess_node(&$vars) {
      if (arg(0) == 'taxonomy') {
        $suggestions = array(
          'node-taxonomy'
        );
        $vars['template_files'] = array_merge($vars['template_files'], $suggestions);
      } 
    

My Taxonomy page is picking up page-taxonomy-term.tpl.php correctly but it just doesn't pick up node-taxonomy.tpl.php and I tried just almost everything.


Solution

  • below few tips and attempts to do:

    • if you are working on subtheme, copy node.tpl.php from parent theme to the folder under subtheme (mandatory in drupal 6 themes).
    • try to check if the node-taxonomy suggestions is correctly added in object $node. var_dump($node) inside the main node.tpl.php and check if is present.
    • last tips: check the permission of the file tpl, maybe is not readable from the web server.