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

Created on 19 May 2019, over 5 years ago
Updated 16 October 2023, about 1 year 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.71.5 2024