call a modules function from preprocess_page I want to be able to call the current nodes taxonomy tree from page.tpl.php by using a function already in the taxonomy module. So far I've only been able to obtain the current nodes taxonomy id with:

$tid = $variables['node']-&gt;field_category['und'][0]['tid'];


I tried using: taxonomy_get_tree($tid);

but this only returns an empty array.

is there a way for me to use functions from other modules in _preprocess_page ?

full code:

function centro_preprocess_page(&amp;$variables) {
     $tid = $variables['node']-&gt;field_category['und'][0]['tid'];
     $variables['taxTree'] = taxonomy_get_tree($tid);
 }
You are getting a taxonomy id. However, taxonomy_get_tree needs a vocabulary id as parameter, according to the documentation: https://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/function/taxonomy_get_tree/7.x . That's probably why you are getting an empty array.

In order to be able to call taxonomy_get_tree, you would need to get the vocabulary id first:

$term = taxonomy_term_load($tid);
$vid = $term-&gt;vid;
print_r(taxonomy_get_tree($vid));


(see this question for more details about getting the vid from a tid).