We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Plugin: AJAX Pagination

Development and Programming

MeanStudios's avatar
MeanStudios
335 posts
16 years ago
MeanStudios's avatar MeanStudios
       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
16 years ago
Sean C. Smith's avatar Sean C. Smith

This looks good - Definitely could have a use for it on a future project.

       
MeanStudios's avatar
MeanStudios
335 posts
16 years ago
MeanStudios's avatar MeanStudios

Thanks Sean 😊.

I updated the plugin. Update notes are in OP.

       
fifteen's avatar
fifteen
108 posts
16 years ago
fifteen's avatar fifteen

Hi Cody,

Thanks for cooking this up. Does it change the url when you page through the pagination this generates?

I gave it a test run today and it’s duplicating h2 on the page and not progressing to the next page. Here’s my setup:

<html>
<head>
[removed][removed]
</head>
<body>
<div id="ajax_content">
{embed="incs/ajax_template"}
</div>
</body>
</html>

{exp:ajax_pagination weblog="weblog" limit="1" template="ajax_template" holder="ajax_content" parse="inward"}
{prev_link} {if prev_link && next_link}|{/if} {next_link}
{exp:weblog:entries weblog="weblog" disable="pagination|member_data|trackbacks" limit="{limit}" offset="{offset}" dynamic="off"}
<h3>{title}</h3>
{/exp:weblog:entries}
{/exp:ajax_pagination}

As you can see I stripped all those original divs out of there trying to get to the bottom of why it’s not working, but I couldn’t figure it out.

       
fifteen's avatar
fifteen
108 posts
16 years ago
fifteen's avatar fifteen

here’s a link to a test page showing what’s happening: http://andyandyandy.com/index/gallery/test/

       
MeanStudios's avatar
MeanStudios
335 posts
16 years ago
MeanStudios's avatar MeanStudios

Andy,

It’s nothing you’ve done. I actually made this while working with the built in EE Calendar and it’s tailored to work with that. I never did test it with weblog entries ><. I’m now looking at the code going, “Oh my god, what was I thinking ahaha.” So I need to update this plugin so it actually works for weblog entries, very sorry 😕.

To answer your question though, no, it does not change the URL. It’s only meant for a small bit of your website, not main content. I wouldn’t recommend using it for main content (when I’ve reworked the plugin) as google won’t like it too much 😊.

Again, sorry about that!

       
fifteen's avatar
fifteen
108 posts
16 years ago
fifteen's avatar fifteen

No problem Cody, thanks for getting back with me so quick! It was simple enough to test out so no worries. I’ll be trying your ajax comments tomorrow, thanks for sharing!

       
MeanStudios's avatar
MeanStudios
335 posts
16 years ago
MeanStudios's avatar MeanStudios

Alright, I have fixed the problem. To make this work, make sure in your Ajax Template in the paramater “template” you enter int your Template Group and Template to your Ajax Template 😊. So if your Ajax Template was called “ajax_stuff” and it’s under the Template Group “includes” then the “template” parameter would be:

template="includes/ajax_stuff"

Have fun! 😊

       
MeanStudios's avatar
MeanStudios
335 posts
16 years ago
MeanStudios's avatar MeanStudios

Updated the plugin again to fix a potential bug for people not removing index.php from their URL’s. The change is to put the full URL to your Ajax Template in the “template” parameter. I’m guessing 99% of the time it could look like this:

template="{site_url}template_group/ajax_template"
       
fifteen's avatar
fifteen
108 posts
16 years ago
fifteen's avatar fifteen

Hi Cody, These udpates still mean it only works with the calendar still right? Andy

       
MeanStudios's avatar
MeanStudios
335 posts
16 years ago
MeanStudios's avatar MeanStudios

Nope, it works for weblogs now 😊.

       
Ida's avatar
Ida
5 posts
16 years ago
Ida's avatar Ida

Hi Just tried out your plugin and it works really well! However is it possible to make it work with orderby and sort also? Now the order doesn’t work when using the prev and next.

       
Ida's avatar
Ida
5 posts
16 years ago
Ida's avatar Ida

Hi again, There is also a problem when I change the limit. It’s the right limit when I first enter the page but when I use the next/prev links it changes to only show 4.

       
Ida's avatar
Ida
5 posts
16 years ago
Ida's avatar Ida

Ignore my last post, just found the problem 😊

       
Graham Huber's avatar
Graham Huber
217 posts
16 years ago
Graham Huber's avatar Graham Huber

Wow, this is excellent! Thank you!!

Any chance of adding number support? (i.e. “Page 1 of 4” and “1 2 3 4” as links)?

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.