Views programmatically limit results I'm trying to programmatically include a view in a module and need to limit the number of results displayed. I tried something like this, but it doesn't work:

$view-&gt;display[$display_id]-&gt;handler-&gt;options['items_per_page'] = 2;


I also tried, but neither this worked:

$view-&gt;display[$display_id]-&gt;display_options['items_per_page'] = 2;


Any ideas? Or at least some links to Views 2 programmatically implementation?

Thanks
You are looking for set_items_per_page()(6), set_items_per_page()(7). Essentially the function does what you are already trying to do, but probably you are calling it on the wrong object, so use the function instead, and Views will ensure it's the right object. :)