Preprocess taxonomy for a custom template file In Drupal 6, I am customizing a view where I am trying to make the taxonomy terms work in all the page template files.

This is the code in the template.php file.

function getTermsName($taxonomy_id) {
  $terms = taxonomy_get_term($taxonomy_id);
  return $terms-&gt;name;
}


This is the code in the custom page template file.

$taxonomy_id = 'term id you got';
echo getTermsName($taxonomy_id);


Nothing happens.

I am quite bad at this; I hope in a very simple solution.

EDIT

With Boriana we found out that the mythemename_preprocess function is not working not taking effect in my drupal. If anyone has idea why, that will be the key to this problem.
If you're trying to use this in your page template files, then you should put your template.php code inside the yourtheme_preprocess_page(&amp;$vars) function.  That's the one that will get called before your page template file, and it can "communicate" its results to the template file by putting them in the $vars variable which was passed to it by reference.

So here's an idea of how you can improve your code:

In template.php:

function mytheme_preprocess_page(&amp;$vars) {
  $term = taxonomy_get_term($taxonomy_id);
  $vars['term_name'] = $terms-&gt;name;     // Store anything you want to use later in $vars
}


In page.tpl:

&lt;?php print $term_name; ?&gt;


Let me know if that helps you get closer!

============================ EDIT =============

The variables set in the hook_preprocess_page() function are only available in your page.tpl files.  If you're trying to get to these variables in your view templates, you'll have to instead use a views pre-processing function, such as mytheme_preprocess_views_view(&amp;$vars)