Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pagination]

The tag has no usage guidance.

1
vote
1answer
17 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 ...
0
votes
0answers
8 views

How to pass Paginate results into a map

I have a a Google Map followed by paginated search results as list items. I'm using the same results object to populate the map and the search results list: {% set results = craft.entries({ ...
1
vote
1answer
20 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 ...
1
vote
0answers
15 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 ...
2
votes
1answer
24 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 ...
0
votes
0answers
22 views

Paginate through structures entries

So i have pagination on each section on my site. What i can't figure out is how to navigate to the next section if it's the last article in the section. Any ideas?
0
votes
0answers
21 views

Paginating with offset and limit not working when there is 1 result more than first page - Optimise?

A complicated one to explain, so I'll jump straight in: {% set pageNumber = craft.request.getPageNum %} {% set firstPageLimit = 8 %} {% set defaultLimit = 9 %} {% set limit = pageNumber == 1 ? ...
2
votes
1answer
32 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'...
0
votes
0answers
24 views

Getting total results count (and/or using pagination) after ElementCriteriaModel is converted to dbCommand via buildElementsQuery

I've implemented a custom search plugin that generates an ElementCriteriaModel, converts it via buildElementsQuery and then adds additional SQL SELECTs (for geo searching over latitude/longitude ...
1
vote
1answer
231 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 ...
0
votes
0answers
59 views

Change paginate URL

I have category pages that paginate and the URLs look something like this: ../blog/category/ux-corner/p2 but I would like to change them to look like this: ../blog/category/ux-corner/2 Is that ...
0
votes
1answer
93 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 %}...
1
vote
1answer
21 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 ...
0
votes
1answer
134 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 ...
1
vote
0answers
46 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 ...
2
votes
3answers
151 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" ...
1
vote
2answers
689 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 "...
0
votes
0answers
73 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 ...
3
votes
1answer
256 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 ...
2
votes
1answer
68 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: ...
1
vote
1answer
118 views

Order a paginated entry by postDate

I'm stumped trying to order paginated entries for a channel. The end goal is to have listings with the most recent postDate at the top. The code below has the most recent item third instead of first. ...
1
vote
2answers
94 views

provide a 'back' or 'cancel' or 'close' button to return to whatever page that particular template was accessed from

I have two templates. For the purpose of this question lets say the first template is step 1, and the second is step 2. There are links to launch these templates all over the site, but some times an ...
0
votes
1answer
147 views

Add page number to Title and meta desc

Want to add page number to title and meta description because I have a lot of duplicates. Could you tell me how I can do it?
1
vote
1answer
57 views

Create a specific order of paginated entries by entry type

I am working with a design that requires entries to be laid out on a listing page in a specific order based on whether they are "Standard" or "Premium". The order of the paginated listing page is as ...
1
vote
1answer
150 views

How to use `{% cache %}` and `{% paginate %}` together?

When using cache tag with pagination should the tag go outside the pagination tag? {% cache %} <div class="grid-x grid-padding-x" data-equalizer data-equalize-on="medium"> {% paginate craft....
1
vote
0answers
292 views

Custom Routes with URL Parameters and Pagination

I am migrating an old EE site to Craft. The EE site has a filter feature for certain weblogs. It outputs a list of entries for a weblog filtering on year, program, etc... which are passed as URL ...
3
votes
1answer
196 views

Check paginated currentPage before setting the paginate tag

This might sound counter-intuitive, but I'm trying to set a specific limit; if the currentPage is the first paginated entry. {% set limit = paginate.currentPage == 1 ? 5 : 8 %} {% paginate craft....
0
votes
0answers
127 views

Craft Pagination

I'm using Craft's {% paginate %} tag. My page is on http://localhost/public/index.php/jobOffer but when I click the next page, it goes to the wrong directory. It jumps on http://localhost/index.php/...
3
votes
1answer
204 views

Check which pagination page to display code outside of pagination loop

I have some Featured news entries which appear at the top of the rest of the news entries. How do I set this so they are only on page 1 (before any pagination pages)? {# Only show on page 1 of ...
1
vote
0answers
245 views

How to add pagination to a filtered category output?

I've been able to successfully filter a set of entries by category, and also include pagination for the complete set of entries (in this case so 6 are displayed per page). But once a category filter ...
1
vote
1answer
2k views

Using pagination with Ajax load.. help need on JS

I am using a template which has a 'LOAD MORE' button beneath a grid of entries (entries 1-10). Click this link loads addition content to the grid via AJAX from another page (which contains entries 11-...
1
vote
1answer
81 views

Pagination, display 'Next 20 Results' etc

Just a quicky regarding pagination. I have a paginated results list with a limit of 20 results in a page. I'm wondering how I owuld go about making a pagination that shows the number of results on ...
1
vote
1answer
75 views

Display only entries relevant to users' country

I'm really struggling with displaying news entry that are only relevant to the users' location. Here is my structure: User Country - > is a dropdown with a single value (lets say UK) Regions is a ...
0
votes
1answer
122 views

Paginate children in a structure

Or to say it in a different way, paginate siblings. I found this question on stack: How do you page through child entries in a structure? which seems to have a working answer. However trying this ...
2
votes
1answer
1k views

filtering entries by category

I've got my news entries paginated and I have a featured entry on the first page so I'm wondering what the best approach would be to filter by category. Here is what my template looks like: {% ...
3
votes
1answer
179 views

pagination showing all entries

I have the following code for my news page. The links show up but I'm seeing all the entries on every page. I'm not sure if this is related to my featured entry at the top. {% extends "_layout" %} {% ...
2
votes
2answers
346 views

How do I get Pagination to Work?

I thought this would be easy. I cut and pasted code that works from the Mijingo Happy Lager tutorial site. But, I keep getting the template error below. My code... {% paginate craft.entries.section(...
1
vote
1answer
236 views

Paginate a matrix

I'm in need of help (again ;-) )... I'm trying to paginate the content of a matrix in a structure, but can't seem to get it done... This is the code I've got: {% for inhoud in entry.getDescendants() %...
3
votes
1answer
55 views

Including Zii in Craft CMS

I have a large dataset of active records (not Craft entries) that I'd like to display in the admin frontend. Yii comes with a widget called CGridView, found here: framework/zii/widgets/grid/CGridView....
1
vote
1answer
143 views

Only fetch structure entries that are first level or sub level that don't have a parent

I have a Structure with my entries in. How can I hide the parent entries that contain children? I still want to show the parents children. For example I want all the below entries bar "About" and "...
1
vote
1answer
422 views

How can I efficiently show the number of total results per channel when retrieving search results?

I have a site with a few channels each with a lot of entries. When retrieving the results from a site search, I’d like to show a paginated list of entries from all sections by default, but then have ...
3
votes
1answer
517 views

Eager-load and pagination

I'm currently working on a relation-heavy website with a colleague of mine and, for that reason, eager-loading stuff looks very appealing to us. We've succeeded in eager-loading pretty much everything ...
1
vote
1answer
527 views

Excluding a single Entry ID of an Entry Type from craft.entries

Any help here would be appreciated… I feel like this is really close. I have 4 entry types, all of which are shown in a blog index: Article Video Image Blurb The most recent entry of the Article ...
0
votes
1answer
78 views

Combined entries from sections across locales

I'm merging entries from two separate sections across locales. All going well but when I try to paginate the results I get the following error: Recoverable error Argument 1 passed to Craft\...
1
vote
1answer
250 views

How to make a sortable table in frontend?

I need to display a sortable table of organization member records in frontend, preferably with pagination. Before I start coding this from scratch, I want to ask: Does anyone have some ideas on how to ...
3
votes
1answer
127 views

Combing an If Statement with Pagination

I'm trying to pull all the entries in a category that have a multi-selection selected and then paginate it. If I just do the below, it works perfectly fine. {% set entriesRed = craft.entries....
3
votes
2answers
249 views

Reverse count with paginated entries?

I have this loop {% paginate craft.entries.section('sermons').limit('10') as pageInfo, entries %} {% for sermon in entries %} ... {{ loop.revindex }} ... {% ...
3
votes
1answer
175 views

Use paginate info in another block

I'm trying to get my head around the following issue. I have a site which uses a base layout template base.twig, on which 3 layout templates are build (using extends). One of them is main.twig. I ...
2
votes
1answer
274 views

Pagination base URL - any way to have pagination links go to URLs other than current one?

TL;DR: Looking for something like paginate_base parameter in EE, but for Craft. My site's homepage has content in tabs for different sections (news, products, etc.) and in each tab I would like to ...
0
votes
2answers
153 views

How do you create pagination links related to entries within a Matrix Field in a single entry?

I have combed through similar questions, although my pagination links are not performing properly. I would like to add pagination links to entries within a channel. And I would like for the ...