Posted By

janlodey on 05/27/11


Tagged

drupal views arguments taxonomy


Versions (?)

Related by taxonomy php views argument


 / Published in: PHP
 

Use this on a Term ID argument - enter the below as provide default agrument - php Code

remember to change the vid to your vocabulary

  1. if (arg(0) != 'node') {
  2. return;
  3. }
  4. $node = node_load(arg(1));
  5. $tids = array();
  6. $vid = 2; // this is the vocabulary id to search through...
  7. $terms = taxonomy_node_get_terms_by_vocabulary($node, $vid);
  8. foreach($terms as $term){
  9. $tids[] = $term->tid;
  10. }
  11. return implode('+',$tids);

Report this snippet  

You need to login to post a comment.