Pagination when there's more than one view that have a pager.

Created on 19 May 2019, about 5 years ago
Updated 16 October 2023, 9 months ago

I created a view that has a views field view, the loaded view via views field view has a pager.
When having multiple views that have a pager we need to assign a unique Pager ID to make it work.

Pager doesn't work correctly on a page consisting of two blocks of which only one with ajax - https://www.drupal.org/project/drupal/issues/2878520 β†’

I tried to below code but with no luck

function MYMODULE_views_pre_view( \Drupal\views\ViewExecutable $view, $display_id, array &$args) {
  if ($display_id == 'archive_slave') {
    $view->pager->options['id'] = get_pager_id(); //get_pager_id() returns a unique number.
  }
}
πŸ› Bug report
Status

Active

Version

1.0

Component

Miscellaneous

Created by

πŸ‡―πŸ‡΄Jordan Ammar Qala

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024