I'm building a view programmatically, and this is the page info configuration i have to do:
$view->query->pager->total_items = $count; $view->query->pager->current_page = isset( $params[ 'page' ] ) ? $params[ 'page' ] : 0; $view->current_page =isset( $params[ 'page' ] ) ? $params[ 'page' ] : 0; $view->query->pager->options[ 'total_pages' ] = ceil( $count / 8 ); $view->total_rows = ceil( $count / 4 ); $view->items_per_page = $view->query->pager->options[ 'items_per_page' ]; $view->query->pager->update_page_info();
The problem is i had to add an infinite scrolling to the view so i used views infinite scroll module, but it's not likeing the way i'm making these settings.
If i say the current page is 0 then the first page is loaded twice and at the end it's not loading all the data.
Could someone point me to the right direction to adjust these settings? Or any idea on what i could do to make this work? It would be much appreciated.