Posted by summit on January 15, 2010 at 8:54pm
Hi,
I am trying to learn views like this one: http://drupaleasy.com/blogs/ryanprice/2008/06/using-views-2-drupal-6-cre...
It looks like this view should work on a node/NID page, but I tried and could only get it to work correct on term/TID pages.
Is this correct?
The phpcode of the term argument is:
$node = node_load(arg(1));
if ($node && $node->taxonomy) { foreach($node->taxonomy as $term) {$terms[] = $term->tid;
} return implode('+' , $terms);
} else { return;
} I would very much like to make a view like this, but then on the node/NID page and then a block of all nodes which have the same terms as the current node/NID
Thanks a lot in advance for your assistance!
Greetings, Martijn
Comments
See
See http://drupal.org/node/684608
Hi, I solved it myself..I had
Hi, I solved it myself..I had to reverse the stuff, aso first argument is the NID and second argument is the taxonomy argument. My enhanced argument code is:
if (arg(0) == 'node' && is_numeric(arg(1))) {$node=node_load(arg(1));
foreach($node->taxonomy as $term) {$terms[] = $term->tid;
return implode('+' , $terms);
}} else { return false;
}