15
votes
Accepted
How to add Pager to a custom page?
There are some examples on drupal.org of adding a pager to the page, if you want to use the one that core uses:
https://api.drupal.org/api/drupal/core%21includes%21pager.inc/function/...
8
votes
Accepted
Views Rest Export and sending page numbers in it's response
As of now there is no way to display total page count in views rest export. But you can get total pages, current page, items per page and total number of items using new custom style in your custom ...
7
votes
Accepted
How to programmatically render a view pager?
The object returned from $views->pager() is an object implementing ViewsPluginInterface and extending PagerPluginBase. If you look at the parameters PagerPluginBase::render() accepts, you will see ...
5
votes
Views Slideshow - Bullets or Numbered Pager not displaying
You can achieve pager using View Slideshow by following steps:
Step 1: In view, add Global: View result counter field and mark it as Exclude from display.
Step 2: Now click on Slideshow format ...
4
votes
Accepted
Display all comments of node without pager (300+ comments)
It's stored in a variable per content type, you can override it like so:
variable_set('comment_default_per_page_CONTENT_TYPE', 500);
Where CONTENT_TYPE is the machine name of the content type.
If ...
4
votes
Clean URL pagination (rewrite ?page=parameter)
You should write a PathProcessor that implements:
Drupal\Core\PathProcessor\InboundPathProcessorInterface
Drupal\Core\PathProcessor\OutboundPathProcessorInterface
Example:
file: modules/custom/...
3
votes
Accepted
why views items per page set to specific values
To be brutally simple: Because someone thought it to be good UX, maintainers agreed, and no one convinced them other way since then. That's all to it.
There are many reasons for drop-down instead of ...
3
votes
Accepted
How to use pager_default_initialize with entity field query?
If your motive is to create a pager for those results, I suggest you to use ->pager() on your EntityFieldQuery.
See this question EntityFieldQuery display pager
if ($type == 21) {
$query = new ...
3
votes
Accepted
Using Migrate API with a multi-page / paginated source
https://www.drupal.org/node/2640516 is the issue to add this support to migrate_plus.
In the meantime, in a case where I knew up front how many pages there were, I simply listed the pages in the urls ...
3
votes
Multiple pagers in single page
You can use the element parameter:
An optional integer to distinguish between multiple pagers on one page.
e.g.
First call:
$output .= theme('pager', array('tags' => array(), 'element' => ...
3
votes
Accepted
Pager with EntityQuery
Add the pager to the build array in which you return the results:
return [
'results' => [
'#theme' => 'mytheme_news_archive',
'#items' => $nodes,
'#path' => $path,...
3
votes
Accepted
How to add a pager at both the top and bottom of a View
Ok, I solved it.
In my theme, I had copied all the content of classy theme because is like a copy of this.
In the theme exist an "templeate" folder, this have another folder called "views" inside ...
2
votes
How can I change the number of items in a view only for the first page?
This is how I got it working, use two hooks. Assuming we have a view called my_view and the display is page_1.
Pre-build: Set the items per page to 10 for the first page.
Pre-render: Add an additional ...
2
votes
Change views pager programmatically
For those using Drupal 8:
If you're like me and made changes to your view in the 'hook_views_query_pre_render' hook then all you need to do to update the page is the following:
$view->result = $...
2
votes
Accepted
Views Calendar Pager Skips a Month Forward
This is a bug in the Date module, fixed by this simple RTBC patch in comment #35
https://www.drupal.org/node/2375235#comment-10205617
2
votes
Accepted
Ajax not output to Ctools modal when using pager
The answer turned out to be a missing class in my pager links. Whenever you use CTools Modal, you have to add the ctools-use-modal class to the link. My first thought was to add the class as a link ...
2
votes
Is there any way to adjust the items per block options?
Yes, the options are hardcoded in \Drupal\views\Plugin\views\display\Block::blockForm() (located in core/modules/views/src/Plugin/views/display/Block.php). It should be relatively possible to ...
2
votes
How to expose paging data in REST export views
Enable pager Exposed option "Allow user to control the number of items displayed in this view" in rest display, then build custom module with views style plugin - to return results and pager data, and ...
2
votes
How to add Pager to a custom page?
As per change record pager_default_initialize() has been deprecated and new pager.manager service is created.
$current_page = \Drupal::service('pager.manager')->createPager($total_count, $...
2
votes
Accepted
Views pagination, jquery and ajax error
Views Ajax is same as the Drupal Ajax, ajax response also run the behaviors.
What you need to do is removing the once() because it will stop your event binding for the second time. For preventing the ...
2
votes
Accepted
How can I fix a pager limited to 2 pages?
You can set items per page for the Home page at Configuration/System/Site information/FRONT PAGE as shown in following image:
And you can check also how many nodes you have promoted to the ...
2
votes
Accepted
AJAXifying content and pagination problems
Try this below solution with views pager ajax enable.
jQuery 1.7+ Version
function runthiscode() {
$(".pager a").each(function(){
$(".pager a").addClass("ajax-link");
$(".pager a").attr('...
2
votes
Accepted
how can add pagination in custom module?
Issue seems to be that you are not attaching your global pager output with rest of content.
Checkout the following code, slightly different but covers up the way to print the pager for a custom menu ...
2
votes
Multiple pagers in single page
I've implemented the multipage on a single page in Drupal 8
Note:- The $element value is the key here. It should be same for both query extend and pager element.
100% working solution. Please find ...
2
votes
Accepted
How do I use paging in a content type containing a paragraph?
Build a view for paragraphs and place it in the content type with an EVA display (Entity Views Attachment).
To do this add a EVA display, connect it to the node entity (content) and bundle (content ...
2
votes
Accepted
Why doesn't my first blog entry show up on my last page?
It turns out that for some reason this particular blog entry had lost its selection of "Promoted to Front Page" in "Publishing". The content type is set to go to front page by default, and this entry ...
2
votes
Getting total count of query in combination with pager
// Use clone.
$query = \Drupal::entityQuery('node');
$query->condition('status', 1);
$query->condition('type', 'news');
$query->pager(9);
**$count_query = clone $query;**
$items = $query->...
2
votes
Rest API pagination
Ensure that you have the Full Pager enabled on the View. This will enable paging. Right now you’re only telling the view to show one thing.
2
votes
Add mini pager and infinite scroll to a view
You're description is a bit ambiguous because first you write
Now after showing four items, 'load more' has to change to ' show less' and hide all four items
but then below you write
Also, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
paging × 394views × 183
7 × 138
theming × 57
ajax × 35
8 × 34
nodes × 25
database × 23
forms × 18
6 × 17
search × 15
entities × 12
javascript × 12
comments × 11
taxonomy-terms × 9
blocks × 8
navigation × 6
datetime × 6
media × 4
uri × 4
9 × 4
hooks × 3
panels × 3
i18n-l10n × 2
caching × 2