I can get this to work when filtering by nid or node title, but why won't it work for user? I also tried table = node & field = nid. I saw something about current user, just not how to use it with views_get_view.

$string = 'jdoe';

$v->add_item('default', 'field', 'users', 'name');
// Add an instance of the 'name' filter.
$options = array('value' => $string, 'operator' => '=');
$id = $v->add_item('default', 'filter', 'users', 'name', $options);

Comments

couloir007’s picture

Title: views_get_view, add_item, filter, and uid or user name: Why won't it work? » views_get_view, add_item, filter, and uid or user name: I can't get to work?
indiralanza’s picture

Hi
I need to recover the related nodes involved in a relationship, I dont know how to do it. Maybe I can make a db query to get the nodes references of other node, or working with views and accesing to the data of the view programally?

If I deside to make my own data base querys, wich tables do I have to access?

I really need to solve it, I dont know how?? Please write back soon.

merlinofchaos’s picture

OP: I don't see any reason why that should not work, to be honest. How doesn't it work?

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Could you please post your entire code?

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

no updates for more than 30 days.