[support] get parent taxonomy tree?

vrao vrao at misteam.net
Wed Nov 23 21:29:57 UTC 2005


I dont think I gave enough info, the hierarchy tree is particularly important for people who use taxonomy_menu.module

For eg, this is what I do..but am wondering if there is an existing solution which also provides the vocab ID (my function doesnt)

function taxonomy_menu_returntree($tid)
{

$tree=$tid;
$query=mysql_query("select parent from term_hierarchy where tid=$tid");
$result=mysql_result($query,0);

while ($result !=0)
{
$tree = $result . "/" . $tree ;
$query=mysql_query("select parent from term_hierarchy where tid=$result");
$result=mysql_result($query,0);

}
return $tree;

}

  ----- Original Message ----- 
  From: vrao 
  To: support at drupal.org 
  Sent: Wednesday, November 23, 2005 3:10 PM
  Subject: [support] get parent taxonomy tree?


  Hi,

  Is there a function to get the parent tree? for example, the full path for term '15' is website.com/taxonomy_menu/3/10/15 .

  Right now, I use taxonomy_get_parents(15) and get to 10..then call it again until I find '0'. Is there a function that either returns the full path of the term or returns the hierarchy tree? 

  taxonomy_get_parents_all seems to do something completely different...

  Thanks,

  V



------------------------------------------------------------------------------


  -- 
  [ Drupal support list | http://lists.drupal.org/ ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20051123/7cbdb2eb/attachment.htm


More information about the support mailing list