Hi. I read docs but it's not very long. I'd like to ask if You cloud advise me.
I need to display some kind of menu with child terms.
I have panel pages with an arguments. Each page have argument - a term which contains some child terms.
And I'd like to display a block with only thos child terms depanding on page.
Is this possible to do this with Taxonomy Filter module?
I described my request more here:
http://drupal.org/node/607116

Comments

solotandem’s picture

Draw me a picture (in words if need be, unless you have a site in progress that shows this). I just want to be sure I understand your request.

Are you using panels? What other modules?

konrad1811’s picture

I have panels and views.
Having a term(argument) I want to display its child-terms.
I tried to send argument (term that has child-terms) from panel to view and prepare view so that it could display children taxonomy terms, but Views don't allow that to show children terms...
Hope I'm clear.

konrad1811’s picture

Title: Block with child terms of a term » Block with child terms of a term - how to

Still nothing...
I belive there is an inteligent way to do this (like views/panels and arguments) by not just typing the links...
However If someone know "how to..." please to show this step by step...

chawl’s picture

This is a hand-made function that I put in my template.php (nothing to do with TF or any other module). This gets all the terms of the node and lists their children in a block if there are any. Parent terms are turned into h2 titles and children are listed under.

<?php
function child_tree_build() {

  if (arg(0) == 'node' && is_numeric(arg(1))) {
  
    $node = node_load(arg(1));
  
    if (count($node->taxonomy)) {

      foreach ($node->taxonomy as $term) {

        $tchild = taxonomy_get_children($term->tid, 2, $key = 'tid');
	
        if(count($tchild)>3) {
          $items = array();
          $subtree = taxonomy_get_tree(2, $term->tid, -1, 1);

          foreach($subtree as $children) {
            $items[] = l($children->name, "taxonomy/term/$children->tid");
          }

          print "<h2><span>". l($term->name, "taxonomy/term/$term->tid"). "</span></h2>"; 
          print theme('item_list', $items);
        }
      }
    }
  }
}
?>

Then I added a new block which contains:

<?php
print child_tree_build();
?>

You should use PHP-code input type for the block of course. This code does not check if terms are associated with a node or not, so empty terms are also listed.

I hope this might be inspiring.

konrad1811’s picture

Great! Thanks! - I'll check this out!