0

Hello i achived this once but for some reason i am having a problem with it this time.

Using D6 and Views 3. I have a block view for random videos.

  • Taxonomy Term ID from URL
  • Load default argument from node page,
  • Validator: taxonomy term
  • Argument Type - Term id's by , or +

Iv checked and unchecked both-

Allow multiple terms per argument

and

Allow multiple arguments to work together

without much success. The desired output would be on a node tagged with 'science' and 'spirituality' the block view would show nodes that are either tagged 'science' or 'spirituality'. At the moment i seem to be getting no results or only nodes tagged with both 'science + spirituality'.

Does anyone know the correct settings for me to show nodes with any of the node's tags?

Thanks

  • When u create your node you can chose multiple values(taxonomy terms) from one field, or you have two or more fields for taxonomy terms? – Petro Popelyshko Dec 12 '12 at 9:58
1

I am not sure for d6, but in d7 you can do it like this(i believe it can be done same way in d6)

In Contextual filters(your Arguments) you need to add Nid like you did, after add new argument has taxonomy term ID and in WHEN THE FILTER VALUE IS NOT AVAILABLE -> provide default value chose not content from URL but PHP code and do this:

You need to load node and get your taxonomy terms from field.

 $node = node_load(arg(1));
  if($node) {
  $field = field_get_items('node', $node, 'field_YOURFIELDNAME');
  if($field) {
      foreach($node->field_YOURFIELDNAME[LANGUAGE_NONE] as $term) { $terms[] =  $term['tid'];          }
    return implode('+',$terms);
  } 
}
  else { return; }

it will return tids of selected taxonomy terms. But its a d7 way with Views 3.

  • mmm thanks neok i dont think its the same really for D6 Views 3. Previously i didnt have to add any code. It all seemed to work with a couple of counter intuitive settings but thanks for your reply. – Reg Gordon Dec 13 '12 at 7:24
  • Hello i am still struggling on with this. I have made up a simple view which you can see here pastebin.com/1khJEUCN – Reg Gordon Dec 19 '12 at 14:49
  • When viewing this node on my site the expected behaviour is for the right hand block to show node in 'chinese' and 'comedy records' (tags) onlinebanter.com/chinese/videos/monty-python-i-chinese at the moment it only shows 'chinese' – Reg Gordon Dec 19 '12 at 14:51
  • Ive went with neok's suggestion as maybe i never ever had it working like i hoped im thinking. I might be getting somewhere as i now get a white screen when viewing a node where the block is placed. It might ust be a problem with the php code for D6 pastebin.com/NpdCzuuq – Reg Gordon Dec 19 '12 at 15:12
  • sorry that was an updated view i last posted there with all the instructions followed as best i could. thanks – Reg Gordon Dec 19 '12 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.