Questions tagged [pagination]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

Prioritising Paid Authors In Entry Queries - Craft 4

I have a Craft CMS 4 website with an entry query that's displaying results in order of priority (1, 2, 3 or 4) and sub priority (1, 2 or 3). I've assigned these numbers to the entries via entry fields....
George Bleasdale's user avatar
1 vote
1 answer
20 views

Show featured entries first without affecting pagination

I have an entries field that can be used to select entries to be featured. I know I can remove the featured entries from the loop with this: {% set query = craft.entries.section('blog') %} {% set ...
Tyssen's user avatar
  • 609
0 votes
2 answers
66 views

How to dispatch equally entries from different channels?

I have entries from two different channels, where each channel has a different total of entries, and I want to display them equally by batch. Example: Channel #1 | Channel #2 | Channel #1 Channel #1 | ...
Romain Poirier's user avatar
1 vote
1 answer
57 views

Pagination breaking following update to Craft 3.7.X

Craft is no longer handling my pagination properly. This follows an update from somewhere around 3.4 to 3.7.X. {% set entries = craft.entries.section(sectionName) .orderBy('postDate DESC') ....
4midori's user avatar
  • 606
1 vote
1 answer
256 views

Sprig replacing search field even with s-preserve="true"

I have a relatively simple search of a section called articles. Each entry within articles has a category assigned. I've named the category animal. Layout is as follows: Header Search/filtering ...
InanisAtheos's user avatar
1 vote
1 answer
114 views

How do you Eager Load Category Fields with Pagination

I have two category fields, teamCategory and articleCategories, on a news listing page that I'm trying to eager load. Problem is, when I add the eager loading it no longer outputs the categories. I ...
doctorgloom's user avatar
1 vote
1 answer
106 views

How to increase control panel pagination item count?

Our client whats to show 200 records in the control-panel entries list per page. Is it possible to change via any config settings?
Parthiban's user avatar
1 vote
1 answer
67 views

Paginate part of the content from page 2

I'm currently using pagination on a database site but I'm having trouble to paginate only part of the content for page 2. Here is an example: Index (page 1): Best products All Products (paginated ...
Nicolas Barse's user avatar
1 vote
1 answer
74 views

Pagination to a different template

I have a blog with a different header on the home page, than the other pages. I would like to show the latest blog posts on the homepage and paginate after 10 posts to the next paginated page, using ...
Markus Busch's user avatar
1 vote
1 answer
422 views

Using UrlHelper from template or remove query string params when paginating?

I have an implementation of a pagination which uses fetch() to get a subset of the page (i.e the page listing and pagination links), so when switching pages it gets the new list, as well as the ...
jishi's user avatar
  • 263
1 vote
1 answer
52 views

Craft 3 paginate not working when fetched with a controller

I'm loading a paginate via Craft::$app->getView()->renderTemplate(), this is being executed within a controller. But my pageInfo.nextUrl is now the url of my controller (/actions/controllername/...
Kevon's user avatar
  • 160
2 votes
1 answer
345 views

Ajax pagination in Craft

I followed this tutorial here on how to paginate without reloading the page: http://craftsnippets.com/articles/dynamic-pagination-for-craft-cms it uses Ajax to load in pagination without re-loading or ...
Wally's user avatar
  • 333
2 votes
2 answers
126 views

Order entries by related "Year" category and paginate?

I have a section called Library, and a category group called libraryYears. The categories in that group are just years (2021, 2020, 2019...) Each entry in the Library is related to a year in the ...
Mike Mella's user avatar
1 vote
1 answer
157 views

Inifinite scroll

I'm not good in programming and I stuck on making infinite scroll on my website. Right now I have the code for pagination that looks like this: {% set query = craft.entries() .section('...
Lukas Snarskis's user avatar
0 votes
0 answers
51 views

How do you Paginate if Looping through element queries directly is deprecated?

I want to create a basic product listing page based on categories. I created a template that dynamically shows all items based on the category that is passed to it based on the help I received here. ...
doctorgloom's user avatar
1 vote
1 answer
49 views

Multiple Queries with differing CSS in Paginated output

{% set query = craft.entries.businessAddress(params).orderBy('Premium desc, distance').limit(12) %} {% paginate query as pageInfo, pageEntries %} <div class="row"> {% ...
springboynick's user avatar
0 votes
1 answer
102 views

Paginate based on items in a Category

I'm trying to wrap my head around Pagination in Craft. I have a template that outputs a list of products based on the Category that is passed to it from this thread: {# Fetch the entries related to ...
doctorgloom's user avatar
0 votes
0 answers
67 views

Paginate and Cache Together and SEOmatic helpers

I am struggling to get this working correctly. If I keep the element queries outside the cache tag then this naturally stops the cache being broken and so is not a viable option. However, when I put ...
Terry Upton's user avatar
  • 1,884
1 vote
1 answer
124 views

Where can I set how the pagination links render?

I have inherited a Craft 3 project in which the pagination links render with a query parameter "page": https://mysite.com/blog/?page=2 but this makes crawlers like HREFS to ignore the Next ...
brunouno's user avatar
  • 154
3 votes
1 answer
1k views

Graphql total results / pageinfo when searching with pagination

I'm trying to build something to search my data that is stored in Craft with graphql. To make pagination work I want to know how many results there are in total. I'm doing a query like this: query($...
Vincent's user avatar
  • 133
1 vote
1 answer
352 views

Looping through element queries directly has been deprecated

on the template _events.twig {% include "./components/_listing" with { entries: craft.entries.section('events').orderBy('eventStartDate ASC').limit(3), columns: 3, heading: 'On this month', ...
Sameera Thilakasiri's user avatar
1 vote
1 answer
113 views

Struggling to get Entry index number so I can output "X of Total Entries"

I have a channel which has multiple entries in, I'm trying to output the current entry number, for example "1 out of 20 posts" Currently this is what I am working with: {% set total = craft.entries()...
George Rowson's user avatar
2 votes
2 answers
190 views

Merge, shuffle, and paginate 😱

I'm trying to get a list of users from two different user groups. One user group (premium) must always show first. Whenever the page is loaded, however, the listing of users should show randomly (...
A Herrera's user avatar
  • 309
1 vote
1 answer
185 views

Paginate entries grouped by day

Been at this a couple of hours and my head is scrambled. Wonder if anyone has already solved it and cares to share? I'm trying to paginate a list of entries grouped by day - showing 3 days worth of ...
Ian Ebden's user avatar
  • 884
1 vote
2 answers
102 views

Sort entries by a related entry (lastName) and then paginate

I have two channels books and authors I need to list all books sorted alphabetically by author. I have this working with the following code: <ul> {# // loop through authors so we can ...
CreateSean's user avatar
  • 1,963
1 vote
1 answer
223 views

Pagination and "if" condition

Some of my entries have the same entry.title. At the frontend, I would like to display these entries only once. This works with the following code: {% set entries = craft.entries().section('produkte')...
TomS's user avatar
  • 213
1 vote
1 answer
210 views

Pagination Slug Issue

I've setup a 'posts' section with a collection of posts. I'm trying to add pagination to the individual post entry. I've copied the pagination code from the Craft CMS documentation but I'm having ...
Joe Consterdine's user avatar
2 votes
1 answer
29 views

Paginate events without setting expiry date

Is there a way to paginate events entries without setting an expiry date for each entry? So I currently have: {% paginate craft.entries.section('eventsEntry').limit(3).orderBy('eventDate') as ...
Andrew's user avatar
  • 740
3 votes
2 answers
728 views

Paginating Merged Element Queries

I really want something like this to work but the merge function turns Elements into Arrays. I've managed to work around it other times but what's the best practice to combine two entry sets and then ...
Matthew Rotter's user avatar
2 votes
1 answer
40 views

Paginate entries ordered by a custom date field

I'm trying to paginate a bunch of events based on their start date. The order part is working correctly, but each consecutive page just loads the exact same entries. My code: {% set events = craft....
Bryce's user avatar
  • 251
1 vote
1 answer
765 views

Order entries by a category field alphabetically then paginate

I've tried so many different things and can't get this to work... {% set makeCat = craft.categories() .group('make') .orderBy('title') .limit(21) %} {% paginate makeCat as pageInfo, ...
kinetikmedia's user avatar
1 vote
1 answer
20 views

Pagination with users

How do I get pagination set up with the following? It should be easy but I'm getting in a muddle. {% set myUserQuery = craft.users().group('members').order('companyName asc').limit(10).find %} {% set ...
sarah3585's user avatar
  • 899
1 vote
2 answers
878 views

Search products and entries with pagination

Is there any way of searching both entries and products at the same time? Wanting a single search on the site which will return all entries and products containing the searched for phrase. Looked at ...
Matt Shearing's user avatar
3 votes
2 answers
220 views

Manually passing page number to paginate tag

{% paginate %} tag takes current subpapage number from url address. Can this behaviour be bypassed and page number be passed directly into {% paginate %} tag?
Piotr Pogorzelski's user avatar
1 vote
1 answer
43 views

Pagination with if statement date modify

How can I incorporate the date_modify into the craft.entries query so that the pagination takes into account this criteria? At the moment the limit is also accounting for past entries and I'm hitting ...
sarah3585's user avatar
  • 899
1 vote
1 answer
86 views

Pagination: Next/Previous related to author

I'm having trouble limiting next/previous links in one channel to articles by the author. next/previous links are working correctly on the regular blog but when included on the DJ blog I get unknown ...
CreateSean's user avatar
  • 1,963
1 vote
1 answer
80 views

Pagination and Entry Model on Homepage

On my site I have some entries with images. In the entry template I paginate the images like so: {% paginate entry.images.limit(1) as images %} My homepage is a single random entry and I want to ...
bstnhnsl's user avatar
  • 123
1 vote
0 answers
35 views

Paginate entries based on related status

So, let's assume I have two channels. events and movies, being events the screening time of each movie. In the admin, in the event entry, you can select one movie. The movie could be disabled. The ...
Jorge Anzola's user avatar
2 votes
1 answer
466 views

{% paginate %} Tag issue, no prevUrl / nextUrl Data

I have problem with the {% paginate%} tag. Setting: Craft CMS 3.0.18 Channel with 3 Entries -> handle "newsBlog" {% paginate craft.entries.section('newsBlog') as pageInfo, pageEntries %} When i ...
thomas's user avatar
  • 81
2 votes
1 answer
342 views

Cache not invalidating when using pagination with cache

Any idea why this code wouldn’t update/break the cache when new items are created? Think perhaps the combination of my code for pagination, cache and the ability to also break for pending entries isn'...
Terry Upton's user avatar
  • 1,884
1 vote
1 answer
842 views

When to hide show more button

I am use a load more button in place of pagination. I just using jquery and ajax using this post as a starting point. The problem I'm having is how to hide the button when there is no more posts to ...
Danielle Frappier's user avatar
0 votes
1 answer
673 views

Cache and Pagination not working

I'm trying to get pagination and cache to work together but it's failing. Here's my current code: {% cache globally using key craft.request.path ~ '/p' ~ craft.request.getPageNum for 2 hours %}...
CreateSean's user avatar
  • 1,963
1 vote
1 answer
38 views

Allowing the user to update a CraftCMS pagination limit with listing filter options

I am building a pagination layout limiting the content to 10 because, well, it makes sense to break down large amounts of content to smaller chunks. But as there is so much, a user might want to ...
Jay's user avatar
  • 1,042
0 votes
1 answer
439 views

Ajax pagination not loading last entries if not equal to pagination number

I've got ajax working on a page but if the number of articles is not exactly 3 (this is the pagination limit) then the remaining 1 or 2 entries do not get loaded. I'm not sure why or how to resolve ...
CreateSean's user avatar
  • 1,963
1 vote
0 answers
170 views

Paginate Results from Restful XML Feed

I'm beginning with Craft/Twig and am developing a plugin that gets data from a Restful XML feed, and I've successfully tested it on my template. Below, I have the working plugin code and a sample of ...
buck1112's user avatar
  • 390
3 votes
3 answers
904 views

Pagination with randomly ordered entries

I have a need to list a set of entries 9 at a time but with a random order. The pagination happens via Ajax, with each next set of 9 entries loaded onto the page when the user clicks the "See more" ...
foamcow's user avatar
  • 2,019
3 votes
2 answers
2k views

Using pagination on a page with url with query string data

I have an index page that filters entries based on url query strings, eg: site.com/inductees?county=123. I put together a very simple pagination setup with next/prev links. However, when I click "...
Steven Thate's user avatar
0 votes
0 answers
272 views

Pagination query

Pagination query/issue. The client/design for a site am building requires the first page to show fewer entries than subsequent pages so been guessing have to write some own/custom pagination jiggery ...
Cole Henley's user avatar
  • 1,741
3 votes
1 answer
1k views

Getting the last X number of pages in pagination

I am working on a pagination for some articles. I am using a for loop to get the 3 pages after and before the current page .getPrevUrls(3) and .getNextUrls(3) So far it looks like this, where 35 is ...
Ricardo Henriquez's user avatar
2 votes
1 answer
300 views

Displaying entries with pagination on a category page where the entry's last category in the array is the current category

I want to only display entries on the category page which is the last in the array of the entries category, so that it doesn't also show on parent category page. Let say these are my categories: ...
Teegan Lincoln's user avatar