View to filter a list of nodes which has TWO taxonomy terms I have a content type - 'video post'.
This content type has several taxonomy terms associated with it, 'star rating' and 'warm up'.

The 'star rating' taxonomy is a list of numbers: 1, 2, 3, 4

The 'warm up' taxonomy has 3 options: warm up, long, cool down.

What I've been trying to do is to create a view block to display on the content type 'video post' so that it displays a list of nodes which have the exact same set of taxonomy terms as the one currently being viewed.

So if I go to node/1 and this has these two taxonomies as follows:

star rating - 2

warm up - long

I only want nodes to display which also have this same combination of terms.

It would also be great if I could exclude the current node from the list too, as this is obviously not required.

I've tried just about everything that I know, but I always seem to get results that I don't want.

Any help is greatly appreciated.
Download the Views PHP module:


  This module allows the admin account (user 1) to add fields, filters
  and sorts to views which use PHP code. It also supports additional
  accounts when the core PHP Filter module is enabled.


In Views:


create a new View of 'video post' content type, as a block and set it up to show all entries for now, in the format and layout you desire
add a contextual filter for the star rating field (you will need to adjust the field names appropriately):


Provide a default value, PHP code:

$node = menu_get_object();
return $node-&gt;field_star_rating['und'][0]['tid'];


add another contextual filter for the warm up field:


Provide a default value, PHP code:

$node = menu_get_object();
return $node-&gt;field_warm_up['und'][0]['tid'];




The first line retrieves the page object (which should only ever be a video post node if the block is set up properly), then returns the term ID associated to the current node as a contextual filter to the view. This assumes a single language site.


add a regular filter, Global PHP code:

$node = menu_get_object();
if($data-&gt;nid == $node-&gt;nid) return true;
else return false;



The first line again retrieves the page object, and compares its node ID with the node ID of the current entry, filtering it if they match. It may appear backwards, but that's how the Global PHP works for some reason. Returning true excludes the row.


under admin/structure/block, set the view-block to show where you want on the page, restrict it to show only on the content type video post.