Related by taxonomy php views argument


/ Published in: PHP
Save to your folder(s)

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

remember to change the vid to your vocabulary


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.