I am using views_infinite_scroll module to load more nodes with 10 nodes on every click and views AJAX is enabled.
I am working on a requirement like as, I have 100 total nodes and getting in a view page. On first load, I need to show 3 nodes and on load more load next 10 nodes.
if(!$view->getPager()->getCurrentPage()){
$view->setItemsPerPage(3);
}
I know above code should work in such case. But the problem
is "next page doesn't include 4-10 nodes while it will show nodes from 11-20 (next 10 nodes). I need to load ignored 7 nodes (4-10) should also appears on next page (?page=1) along with next 3 nodes (11-13).
I have tried hook_views_pre_render
, hook_views_post_render
, hook_views_pre_build
, hook_views_post_build
, hook_views_query_alter
etc. but no success to load ignored nodes on next page (?page=1) while load more using AJAX.
Any kind of help or suggestion would be appreciated.