Change the pager and the number of elements per page of a specific view I create a view (FO) that lists certain content type. By default, I put a pager (mini) and a number of items per page (content 10 per page).

This view, I integrated into a content type (CFTO) in addition to other parameters.
If I agree, I want to use my other variables to redefine this view without saving it in a database (eg disable the pager / display 3 content page / ...)

I try different hooks as hook_views_pre_view, hook_views_pre_render, views_pre_build, but nothing works.
I can not change the number of a content page. This is my different test : 

I wish i could change my view different information as enable / disable pager and more then change the number of elements of the page.

I find a way of hook_views_pre_render(&amp;$views) to change the pager and more. It works well.

function my_views_pre_render(&amp;$view){
//For more
$view-&gt;display['page']-&gt;handler-&gt;options['use_more'] = TRUE;

//For pager
if(!$this_node_pager_value) {
    $view-&gt;query-&gt;pager-&gt;set_items_per_page($view-&gt;total_rows);
    $view-&gt;query-&gt;pager-&gt;update_page_info();
}}


Now i wish i could change the number of elements in my page to display, I tested this code in different hook sities previously.

function my_views_pre_render(&amp;$view){
if($this_node_pager_value) {
//TEST 1
$view-&gt;query-&gt;pager-&gt;set_items_per_page(3);
$view-&gt;query-&gt;pager-&gt;update_page_info();

//TEST 2
$view-&gt;exposed_raw_input['items_per_page'] = 3;
}}

function my_views_pre_view(&amp;$view, &amp;$display_id, &amp;$args){
//TEST 1
$view-&gt;display_handler-&gt;display-&gt;display_options['pager']['options']['items_per_page'] = 3;

//TEST 2
$view-&gt;query-&gt;pager-&gt;set_items_per_page(3);
$view-&gt;query-&gt;pager-&gt;update_page_info();

//TEST 3
$view-&gt;exposed_raw_input['items_per_page'] = 3; 
}

function my_views_pre_execute(&amp;$view){
//TEST 1
$view-&gt;display_handler-&gt;display-&gt;display_options['pager']['options']['items_per_page'] = 3;
//TEST 2
$view-&gt;query-&gt;pager-&gt;set_items_per_page(3);
$view-&gt;query-&gt;pager-&gt;update_page_info();
//TEST 3
$view-&gt;exposed_raw_input['items_per_page'] = 3;
//TEST 4
$view-&gt;display_handler-&gt;set_option('items_per_page', 3);
}


function cci_generic_views_pre_build(&amp;$view){
//TEST 1
$view-&gt;pager["items_per_page"] = 3;
//TEST 2
$view-&gt;display_handler-&gt;options['pager']['options']['items_per_page'] = 2;
//TEST 3
$view-&gt;display_handler-&gt;options['pager']['options']['expose']['items_per_page'] = 2;
}


None works. Would you know what should be done to make it work?

You would know what is the right hook to use? And how to change this value?
thank you for your help 

Djik
The following should work in hook_views_pre_build(&amp;$view):

$view-&gt;set_items_per_page(5);