ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Get paginate page number?

January 30, 2011 9:57am

Subscribe [5]
  • #1 / Jan 30, 2011 9:57am

    Hi all,

    I am building a new site and I will use AJAX to create a next and prev page style navigation but just ran into a small issue, is there a way I can call the paginate page number only (e.g. P5 or P10) and not the full URL path (e.g. http://localhost/site/P5)

    I tried {auto_path} but didn’t work.

    Any ideas?

    Thanks,
    Tony

  • #2 / Jan 31, 2011 8:16am

    Sue Crocker

    26054 posts

    Hi, Tony. The easiest way would be to let the pagination occur naturally, but use one of the existing third party find and replace plugins take away the extra path information. You can find a few over on Devot-ee.com.

    Does that help?

  • #3 / Jan 31, 2011 9:26am

    Hi Sue,

    Thanks for the reply and for the idea, I downloaded a few find and replace plugins and also used PHP string replace but still can’t get rid of the path?!

    At the moment I use the

    {if next_page}<a href="http://{auto_path}">Next page</a>{/if}

    for the navigation of my pages and that always works but it’s no matter what I try nothing works?! I just can’t remove the path :(

    Is there any thing else I can use rather than {auto_path}??

    Thanks for the help!
    Best regards,
    Tony

  • #4 / Feb 01, 2011 3:54am

    John Henry Donovan

    12339 posts

    Tony,

    Would the paginate_base= parameter be useful at all?

    Try this replace plugin

  • #5 / Feb 01, 2011 6:48am

    Hi John,

    Thanks for that, I did try that replace plugin but still no joy :( no matter what I try I still can’t change the URL of the pagination link as it still shows the full site path.

    Still trying and will post back if I crack it.

    Thanks,
    Tony

  • #6 / Feb 01, 2011 5:29pm

    Ingmar

    29245 posts

    Sound good. Depending on your setup you might be able to simply use {segment_2} or {segment_3} to reference the pagination number, perhaps with a bit of added PHP.

  • #7 / Feb 04, 2011 7:08am

    Dear all,

    I managed to get it to work :D YAY the paginate_base= was the right way to do it and all I had to do was set paginate_base=”#index.php” and then it just worked so no need for any replace plugins for this.

    Thank you all again, the EE support is just the best there is! So happy to use EE!

    Tony

  • #8 / Feb 05, 2011 12:49pm

    Greg Salt

    3988 posts

    Tony,

    Excellent. Please post back if required.

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases