Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2009 at 00:48 UTC
Updated:
24 Aug 2009 at 05:51 UTC
I have made a view with pager set to 'yes' and items per page to '15'.
Here is a partial paste of an export of my view to show where this information is stored
$handler = $view->new_display('default', 'Defaults', 'default');
---snip---
$handler->override_option('items_per_page', 15);
$handler->override_option('use_pager', '1');
However if I load the view up with <?php $view = views_get_view('view-name'); ?> and execute I only get 10 items per page. If I dsm($view->pager) I see this:
#pager (Array, 5 elements)
* use_pager (Boolean) FALSE
* items_per_page (Integer) 10
* element (Integer) 0
* offset (Integer) 0
* current_page (Integer) 0
So it's defaulting it to '10' even though both displays in the view settings are configured to '15'.
I don't want to programatically set it to '15' - I just want it to pick up the settings from the UI, how do I do that?
Comments
Comment #1
dawehneryou could use
Comment #2
danielb commentedSee, that won't work because I will need to supply my own value for $items_per_page to use that - it is a number I do not know, and it's not available in the $view object.
Comment #3
cchan commentedsubscribing.
Comment #4
cchan commentedFixed. The problem was solved by calling
$view->preview()before$view->render(). Thanks for your help.Comment #5
cchan commented