Questions tagged [paging]

The process of splitting the result of a query on different pages is called, in Drupal terminology, paging.

Filter by
Sorted by
Tagged with
0 votes
1 answer
31 views

How to theme a pager with twig?

I've added a pager to a custom page rendered programmatically from a controller. I want to customize the pager. How can I do it without overriding the standard pager twig? This is the hook_theme: ...
0 votes
0 answers
24 views

All pagers stopped working

I have a Drupal 7 site built in 2014 with numerous pagers built in. Most of the pagers are in custom modules and are rendered using the following code. $pager = theme('pager', array('quantity' => ...
  • 21
0 votes
0 answers
43 views

How can I add a pager to \Drupal::entityQuery()?

We are trying to add a pager using the pagerer module for a list of nodes. The aim is to list tagged articles in a tag page, but it doesn't work. It returns null. When we dump the data without the ...
0 votes
0 answers
14 views

How can we get the current number of items out of total using PagerSelectExtender Class?

We are using PagerSelectExtender Class to create a pager. Along with pager we need to show the item records e.g. 25 - 50 out of 625 considering we are on second page 50 - 75 out of 625 considering ...
  • 4,279
0 votes
0 answers
9 views

Paginate unformatted view

I would like to just render the {{pager}} variable inside a views-view-unformmatted twig template, but the variable seems to be only available for formatted views. Which is the easiest way to do the ...
  • 11
0 votes
0 answers
101 views

Nested views ajax pagination

I am using Drupal 9 and views_field_view to embed a "child" view within a "parent" view. Because there are multiple rows in the parent view, I end up with multiple of the same &...
  • 101
-3 votes
1 answer
32 views

Search and pagination in media popup don't work properly [closed]

In the /admin/content/media page, I have more than one button for the pagination. The search is working properly. When I edit a media on some node, in the popup, I only have one button in the ...
  • 43
1 vote
1 answer
77 views

How do I force the pager to update?

I have a custom form built with the Form API. The general flow is: Build and display form Get user input Rebuild and form query based on user input with added $query = $query ->extend('Drupal\\...
0 votes
1 answer
26 views

How do I change pager (# of items) for one page display in a view?

I have a view that will have about 7 different display pages. Some of the pages will have a different amount of items displayed on that page. When I'm on my Publication Page (display name) and change ...
0 votes
1 answer
50 views

Can I add pagination to individual blog posts in my twig file?

I have a views page which has all the blog articles, and you can click on a link to bring you to a single blog page. On that single blog page I want to be able to add buttons for Previous and Next ...
  • 163
0 votes
0 answers
61 views

Views pager not printing

I am working on a project in Drupal 7 and the pager is not working properly. It will display on the block but not on the page no matter what I do. I have even tried changing the pager_id and that ...
4 votes
2 answers
66 views

Alter comment pager to jump to comment section right away?

I set up a content type and a specific comment type for this content. I set the comment pager to display 10 comments per page. When I now use the pager, I get redirected from the node URL itself www....
2 votes
1 answer
724 views

How can I implement paging for a custom query plugin which displays data from an external API?

Hi I have a requirement to display the data from external api but should not be imported into any entities. What I did is I have written a custom view query plugin which displays the data from ...
  • 29
2 votes
0 answers
62 views

Different 'Items Per Page' on different pagination while using 'views_infinite_scroll' module

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 ...
0 votes
2 answers
108 views

How to create a pager to display next article in particular taxonomy? [closed]

How to create a pager to display next article in particular taxonomy? I can not find any module. I tried to do this with a view. I created a view that display all content from article and add a pager,...
1 vote
0 answers
291 views

Paginated ajax form with non-sql data

Using Drupal 8 I created a form to load data from a webservice with ajax below the form. Now i'm trying to add pagination to result, but the paginator is not been loaded, i'm doing something wrong?. I'...
0 votes
2 answers
372 views

Paginated form with ajax checkboxes throws "The specified #ajax callback is empty or not callable"

Using Drupal 8.7.7 I have a form which consists of a paginated table of users. Each user row has a checkbox element in the form with an ajax event attached. This is essentially to allow me to store ...
  • 169
0 votes
2 answers
193 views

How add pager with external request

After many search and read posts, I'm still stuck with my code. Let me explain : I created a custom module who display newsletters from Mailjet and old newsletters comming from drupal. To avoid the ...
  • 1
0 votes
0 answers
1k views

View page count in Twig template

I can't seem to figure out how to get all this information in one line in a views template. <div class="pagination--totals"> Page @current_page of @page_count <small>(@total Results ...
  • 480
1 vote
1 answer
50 views

How to align views pager url with real page number?

When creating pager in views (D7) you get urls with query parameter like page=X by default. But this X does not match actual page number. page=1 is generated for 2 link in the paginator and so on. ...
  • 91
0 votes
1 answer
128 views

Pagination in external api consume custom module

I created a custom module in order to consume an external api call in my drupal project following this question. The module is working fine, but I need to have a pagination in the received results ...
0 votes
1 answer
135 views

Within a View, How do i paginate the content found inside a single Multiple file field, i.e. inside one node

Hopefully someone can help. I am using a file field and allowing unlimited files within a single content type field called "Video", handled by Media Module. I have created a view per "gallery" of ...
  • 20
1 vote
1 answer
858 views

Creating a table with pagination in a Node Edit form

I have a content type article that has a field for Category. In order to help our editors find related articles, I included a table on the article Edit page that pulls in other article entities that ...
0 votes
1 answer
162 views

How can I populate multiple blocks on a paginated page?

my problem seemed simple to solve and how to do it. But the paging did not work properly .. As we see in the images, we have: Main block with an image and description. It only shows 1 element. ...
1 vote
1 answer
3k views

How to add pagination to programmatically rendered search result template

I am trying to implement the pagination in drupal 8 custom page. I have a custom array which I am rendering using theme, I need to add pagination for it. $internal_result = array_merge($...
2 votes
0 answers
108 views

How to change the pagination position

I have created a custom block using Entity Query with pagination to get the data and everything works fine with $render[] = [ '#type' => 'pager', ]; But I can find a way to change the position ...
  • 21
2 votes
1 answer
602 views

how rewrite pagination URL views for SEO?

i am trying to rewrite the views url pagination : /mypath/cat?page=1 to /mypath/cat/1 or > /mypath/cat/page/1 or /mypath/cat-1 cat is a taxonomy term. I have tried to rewrite url with Drupal\...
  • 2,440
0 votes
1 answer
579 views

Add mini pager and infinite scroll to a view

I have a view where at first 1 item has to show. On click of 'load more' next item has to show and so on. For this i have installed 'infinite scroll module' in drupal 8. Now after showing four items, '...
  • 1
6 votes
1 answer
3k views

Clean URL pagination (rewrite ?page=parameter)

One of my client works with an SEO agency and they ask me to remove the pagination parameter ?page=x (generated by the Views module) and rewrite it like this: Before: /my-page?page=1 After: /my-...
1 vote
1 answer
522 views

Rest API pagination

I am using drupal 8.5 and have tried everything people say to get pagination working, but it does not over rest api. I have 2 news articles, and I set the page value to 1 per page. I have tried ...
0 votes
1 answer
890 views

how to get count of total record

I'm using drupal pagination here i have add some part of my code pagination is working perfect while I'm trying to get the total no of record it is always displaying 10. As i understand i have set the ...
0 votes
2 answers
1k views

How to add a pager at both the top and bottom of a View

How can I do this for Drupal 8? I have searched for a solution but I didn't find anything yet, I hope some one here can help me. I have this "pager.html.twig" (from the clasy theme) template in the ...
-1 votes
1 answer
75 views

How to fix Filter selections on VIEW result pages

1] I am using Exposed Filters (Page Display - not Block Display) in a view. 2] Sorting by three parameters: Materials, Machines, Industry(s) 3] Using Paging to deliver Results 4] Filters have "...
0 votes
0 answers
655 views

Is there a way to add pagination to only a tableselect returned from ajax callback? [duplicate]

Have a simple form with few inputs as a filter criteria. Selecting these and clicking on a submit button executes a callback function that returns a table and a pager. Code: //submit button $form['...
  • 29
0 votes
0 answers
225 views

How to add pagination in a block created from a custom module?

I have made a very simple block that displays an array of strings as a list. I am achieving this by implementing hook_block_view() in my .module file. Right now the list displays ok, but I would like ...
0 votes
1 answer
729 views

Using ajaxComplete in view pagination

I have (drupal 7) view where I have pagination with Ajax enabled. When any pager item is clicked I want to perform certain thing after the view is reloaded with ajax. I am trying the following code: (...
0 votes
0 answers
105 views

Pager not rendering in custom twig template [duplicate]

I have custom twig template for product listing Below is my code in controller $query = \Drupal::entityQuery('node') ->condition('status', 1) ->condition('type', 'product') ->pager(1) ->...
  • 29
2 votes
0 answers
772 views

Drupal Ajax pager

Am looking for a solution to implement $form['pager'] = ['#type' => 'pager']; into AJAX callback (without reloading the page). I have read alot of posts concluding there is no a drupal way to do this ...
0 votes
0 answers
113 views

Caching problem: Why does the pager of my pages module not work?

I am using the pages module in combination with the view module on the front page of my website. This worked until recently, when my pager started to behave strangely. The pager does not work anymore ...
  • 129
0 votes
1 answer
63 views

Why don't all pages of content show up in the pagination beneath main content?

On a Drupal 7 site, I have several pages' worth of content, articles that are set to "published" and "promoted to front page". The page numbers underneath the main content part of the block show pages ...
1 vote
2 answers
928 views

Pager labels aren't translated

I have a site using Drupal 8.4.1 with all core language modules enabled, 3 active languages, and where English is the default language. The pager labels (e.g. "Last »") for my own views aren't ...
4 votes
1 answer
2k views

Views Rest Export and sending page numbers in it's response

I have a paginated views using "rest export" and I'm using it to show that data on mobile app, everything works fine, but I want to know how many pages exist on that endpoint to show page numbers in ...
1 vote
1 answer
233 views

How can I display a block on view page, excluding paginated/paged/pager output pages?

I'm trying to use Context to display a block on a view page path, e.g. /view, but exclude it from the paged output, e.g. /view?page=1. The path exclusion tools in Drupal 8 don't work with the query ...
1 vote
2 answers
829 views

Getting total count of query in combination with pager

My code: $query = \Drupal::entityQuery('node'); $query->condition('status', 1); $query->condition('type', 'news'); $query->pager(9); $count = $query->count()->execute(); However my $...
  • 231
1 vote
1 answer
270 views

Attachment pager

I have a Drupal 7 page View which returns one result while an attachment View (with offset 1) returns the rest. (First result displays title, body, image, etc. while the following rows only return ...
-1 votes
1 answer
2k views

How do I add a pagination on a template file?

I'm currently new with Drupal 8 and right now I'm trying to output a pagination on my twig file using entity query. So far this is my current code that I came up with. My goal is output the news ...
user avatar
-1 votes
1 answer
1k views

Custom pagination with template

So I have a custom module where there is a basic function that returns an array of data where I try to add a pager. I then call the function in the template.php the pass a custom variable to my ...
  • 46
4 votes
1 answer
830 views

Views with ajax get current node in hook_views_query_alter

The view has on offset based on a value set in the Basic page node. function domain_config_bu_views_query_alter(ViewExecutable $view, QueryPluginBase $query) { if($node = \Drupal::routeMatch()-&...
  • 333
-1 votes
1 answer
64 views

Why doesn't my first blog entry show up on my last page?

On a site that I created a few years ago, my very first blog post does not show up when I browse from the front page to the last page. All my other blog entries seem to show up there. When I manually ...
-1 votes
1 answer
140 views

Modifying [current-page:page-number] token

I am using [current-page:page-number] token in title and metatag description. Pager in views, gives second page of view as "Page 1" and token gives first page of view as "Page 1". This creates ...
  • 357

1
2 3 4 5
8