title: Why isn't $vars['node'] available in preprocess_page for some content types?
body: <p>I am currently using drupal 6 for a site I'm working on. I have a MYTHEME_preprocess_page() function that adds a few variables to the page.tpl.php template from the taxonomy and from a cck field. It was working correctly for a bit, and then the $vars['node'] is empty, but only for 2 content types. The 'node' variable is available to the preprocess_page function in other content types. </p>
  
  <p>I thought it was a problem with using the following code, but when I remove all of this, the 'node' variable is still empty. </p>
  
  <pre><code>function mytheme_preprocess_node(&amp;$vars, $hook) {
    $function = 'mytheme_preprocess_node'.'_'. $vars['node']-&gt;type;
    if (function_exists($function)) {
     $function(&amp;$vars);
    }
  }
  </code></pre>
  
  <p>Does anyone know of any gotchas or bugs that might be removing the 'node' variable? I can't seem to figure out where I'm going wrong. I'm at a loss.</p>
  
  <p>Here is my complete mytheme_preprocess_page() function.</p>
  
  <pre><code>function mytheme_preprocess_page(&amp;$vars, $hook) {
    if ($hook == 'node' || $hook == 'page') {
  
      if (is_object($vars['node'])) {
        // grab the header image if it exists to make it avaialble to the content header
        $vars['header_image'] = _mytheme_get_header_image($vars);
  
        // get the taxonomy term to put in the content header
        if (count($vars['node']-&gt;taxonomy) &gt; 0) {
          $vars['tax_term'] = "&lt;div class=\"terms\"&gt;" . _mytheme_get_first_taxonomy_term($vars['node']-&gt;taxonomy) . "&lt;/div&gt;";
        }
  
        // add the teacher's credentials to the content header
        if ($vars['node']-&gt;field_credentials[0]['view'] != '') {
          $vars['teacher_credentials'] = '&lt;span class="teacher-creds"&gt;' . $vars['node']-&gt;field_credentials[0]['view'] . '&lt;/span&gt;';
        }
      }
    }
  }
  </code></pre>