As per subject, it is getting around 10 items for me instead of the 4 I set in the display settings.

CommentFileSizeAuthor
#2 view_export.txt14.58 KBgiorgio79

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Paste your code.
Paste your view.

giorgio79’s picture

StatusFileSize
new14.58 KB

Thanks Daniel, here is the code, it is very simple:

$view = views_get_view('related');
$view->exposed_input['keys'] = check_plain(str_replace(" "," OR ",$node->title));
$view->set_items_per_page(4); // Items to display not respected
$view->set_arguments($args);
print $view->render('block_1');

For now I use set_items_per_page so I get only as much as I want :)

I am adding the view in a txt so we wont have to scroll too much :)

dawehner’s picture

Status: Postponed (maintainer needs more info) » Active

.

dawehner’s picture

I don't know why do you use the render function? This is supposed to be runned after pre_execute, which you miss to execute.

I suggest to use $view->preview($display_id) instead. With this i think this will be fixed.

giorgio79’s picture

Status: Active » Postponed

With the print $view->render('block_1'); I just want to print out the view that's it :)

Not sure about all the execute and preexecute stuff, but will try the preview as you mention.

kenorb’s picture

Status: Fixed » Postponed

#4 thanks, preview worked

dawehner’s picture

Status: Postponed » Fixed

Sure it does :)

Status: Postponed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.