I have created a custom theme where i add some variables

function blackresponse_preprocess_node(&$vars) {
...
$vid = db_query("SELECT vid FROM ip_taxonomy_vocabulary WHERE machine_name LIKE '%video%' ")->fetchField();
	$catnames = taxonomy_get_tree($vid, 0, 1, TRUE);
	$vars['cats'] = $catnames;

I can see the vars in my firePHP logging.
However, the $vars array is empty in my node--video.tpl.php.

Do I need to pass it somehow ?

Comments

elgwiedo’s picture

OK, I found it myself.
Thought I could use

foreach ($vars['cats'] as $cat) {
....
};

but this worked :

foreach ($cats as $cat) {
...
}