2

I use to validate view's (block display) filter with PHP code to push argument(s) to view. e.g. Providing a related content list on the base of taxonomy terms is done by creating a taxonomy term id filter and setting a PHP validator as:

$node = node_load(arg(1));
$terms = array();
if($node) {
  foreach($node->taxonomy as $id => $tax) {
    $terms[] = $id;
  }
  return join('+', $terms);
}

This filter lists all such nodes which have any association to the term id(s) that is/are associated with the node being viewed.

I know this approach is a hack but it works for all inclusive arguments.

How to use this approach for exclusive arguments. e.g. Excluding the node (on the behalf of id) from the list that is being viewed. Means every related to this but not this.

Your Answer

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

Browse other questions tagged or ask your own question.