• Resolved cherryaustin

    (@cherryaustin)


    OK, I know this is a big ask – and I’m already deliriously happy with this plugin! To make it even more perfect, how could I make it load the next chunk of results without refreshing the whole page?

    I don’t mind having a go at this myself, but I’m only a medium jQuery user and would need a lot of pointers. Have you done this before?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor zymeth25

    (@zymeth25)

    It is on our to-do list and will be implemented at some stage ??

    Instead of writing Ajax requests yourself you can use this plugin. I can guarantee that it works because I have tested and used it myself with the LCP plugin.

    We would still prefer not to have to install additional plugins, so we will be working towards integrated Ajax feature for this plugin.

    hello..

    i have try with your recommendation using “Ajax Pagination and Infinite Scroll” plugin..
    But, How to set the “4 required selectors” (Posts Selector, Navigation Selector, Next Selector)… Can u give the example..?

    BTW, thx a lot for LCP plugin.. i’ve used it for many parts of my template, such as: home page, related post, and widget.. it’s very helpfull..

    Plugin Contributor zymeth25

    (@zymeth25)

    Glad you have found the plugin useful ??

    Let’s go through all 4 according to the Ajax plugin documentation. Given we are using [catlist pagination=yes numberposts=10] shortcode with no styling parameters, we have:

    ‘Posts Selector’ The selector that wraps all of the posts/products.

    this should be set to .lcp_catlist because that’s the CSS class LCP plugin assigns by default

    ‘Post Selector’ The selector of an individual post/product.

    we set this to li which is the default.

    ‘Navigation Selector’ The selector of the post/product navigation.

    We set it to the pagination element’s default class .lcp_paginator.

    ‘Next Selector’ The selector of the navigation next link.

    LCP plugin automatically assigns classes to ‘next’ and ‘previous’ links. Set this to .lcp_nextlink.

    Thread Starter cherryaustin

    (@cherryaustin)

    Thanks for all your help! Also to @agengpd for a useful question.

    Hello again @zymeth25 and @cherryaustin … ??

    I’ve tried using malinky-ajax plugin and have no trouble with 1 lcp paginator..
    but, in my other pages which have 2 or more paginators, the malinky plugins can’t detect the paginators, because have same Class Name..

    Can we give/change the class name for lcp_paginator?? so, if we use more than 1 paginator, the malinky plugins and our CSS can recognize each paginator…

    • This reply was modified 6 years, 8 months ago by agengpd.
    Plugin Contributor zymeth25

    (@zymeth25)

    Hi @agengpd

    This is not because of the lcp_paginator class.

    You are correct, with the setup I described previously it only works witn one LCP instance on a page. If you look at the Ajax plugin settings you will see that under “Posts selector” there is this info “If displaying multiple paginations on the same page this must be a parent of the navigation selector.” and under “Navigation Selector” there is “If displaying multiple paginations on the same page this must be a child of the posts selector.”

    In the default LCP html output the navigation selector is not a child of the posts selector, i.e. .lcp_paginator is a sibling of .lcp_catlist. It must be a child for multiple LCP instances to work with the Ajax plugin.

    This can be solved by using LCP custom templates. Follow the docs to setup your template. In the default template file you will see that pagination is inserted on line 117:

    //Pagination
    $lcp_display_output .= $this->get_pagination();

    but the loop wrapper, i.e. posts selector, is closed earlier on line 108:

    // Close the wrapper I opened at the beginning:
    $lcp_display_output .= '</ul>';

    So now we need to make the pagination a child, not a sibling, of the posts selector. That’s easy: move the pagination code above the wrapper closing tag.

    One important thing to note here is that if you only do that, your list will look a bit differently than without a custom template. This is because the default.php template file produces a slightly different output, for instance it wraps titles in h3 tags. But you can adjust it to what you need without much effort.

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Ajax refresh on pagination click?’ is closed to new replies.