Hi,
I have a nodes view, from which I try to exclude nodes given by another view.
So I added a node argument in my view, and gave it a default argument "php code", which is this ('dernierstar' is the second view, the one that gives nodes IDs to exclude) :
$view_name = [dernierstar];
$view_display = [0];
$view_arguments = array();
$this_view = views_get_view($view_name);
$this_view->set_item($view_display, 'filter', 'nid_php', NULL);
$this_view->set_display($view_display);
$this_view->set_arguments($view_arguments);
$this_view->pre_execute();
$this_view->execute();
$results = $this_view->result;
$this_view->destroy();
print $results;Where am I wrong ?
Thanks !
Comments
Comment #1
dave reidComment #2
esmerel commentedNo activity in 6 months