Привет всем!
У меня есть кусок кода на php.. он вставляется в блок и соответственно его прямая функция - вывод категории и его терминов.
Вот он код:
<?php
// accordion taxonomy menu
// by Chris Herberte
// ** don't forget to change $vocabulary --vv
//
$vocabulary = 3; // <-- change ########## to your vid (e.g 1)
drupal_add_js('misc/collapse.js');
$lastdepth = 1;
$topoflist = 1;
$nid = 0;
if ( arg(0) == 'node' && is_numeric(arg(1)) && ! arg(2) ) {
$nid = arg(1);
$terms = taxonomy_node_get_terms($nid);
rsort($terms);
$tid = $terms[0]->tid;
}
elseif (arg(0) == 'taxonomy' && arg(1) == 'term') {
$terms = preg_split('/[+ ,]/', arg(2));
$tid = $terms[0];
}
$parents = taxonomy_get_parents($tid);
foreach ($parents as $parent) {
$i++;
}
$tree = taxonomy_get_tree($vocabulary);
foreach ($tree as $term) {