Giter Site home page Giter Site logo

Comments (11)

samcleaver avatar samcleaver commented on April 27, 2024

Hi Benoon,
Do you have a test case/example I can view? It'll make resolving the issue a lot easier if we can debug it. Vladikoff's solution doesn't seem to be using the latest version of the plugin and so it won't necessarily have any of the latest bug fixes.

from infinite-scroll.

benoon avatar benoon commented on April 27, 2024

I've got it locally, just playing around right now.
The link shows ?page=1 but your plugin goes to ?page=2 and the second page is missed.
I use last Drupal and Views 2.

from infinite-scroll.

samcleaver avatar samcleaver commented on April 27, 2024

I know that the script presumes that it's already on page 1 and then goes to page 2; I'll have a look into this as I would have thought the regex would pick this up.

from infinite-scroll.

benoon avatar benoon commented on April 27, 2024

No, that's wrong then. It's not on page 1. It's like that:

page 1 - http://drupalsite.com/newview/
page 2 - http://drupalsite.com/newview/?page=1
page 3 - http://drupalsite.com/newview/?page=2
....

Also is important to know that when you go after last page you don't get 404.

Example:

last page - http://drupalsite.com/newview/?page=12
then when you manualy add to url the next number - http://drupalsite.com/newview/?page=13 - it goes to page 1 , so the scroll is never ending.

Vladikoff made some improvments and added few lines which takes the number of page from the LAST link and stops scroll on the last page.

        //Get the number of pages from the Views Pager (Use the full pager, it will be hidden with .infinitescroll() anyway.)
        lastPageHref = $(".pager-last").find('a').attr('href').toString(); 
        lastPageHref = lastPageHref.split("=");
        numOfPages = parseInt(lastPageHref[1]);

and then new parameter when initializing your plugin:

            pages: numOfPages, //NEW OPTION: number of pages in the Views Pager

I use it right now, so the only problem is that the second page is still passed.

from infinite-scroll.

lukeshumard avatar lukeshumard commented on April 27, 2024

are you using the pathParse option when calling your instance of infinite scroll?

from infinite-scroll.

benoon avatar benoon commented on April 27, 2024

no, did I miss something ? is that some kind of parameter ?

from infinite-scroll.

lukeshumard avatar lukeshumard commented on April 27, 2024

https://github.com/paulirish/infinite-scroll/blob/master/jquery.infinitescroll.js#L338

pathParse allows you to specify the path of the URL for your next selector. i think it was requested for use with drupal, but i'm not entirely sure.

by default, infinite scroll only loads on the first page, not any other paged result. is there a reason why would want to do that? i'm just curious as it could be something we build into the plugin if there's demand for it.

from infinite-scroll.

lukeshumard avatar lukeshumard commented on April 27, 2024

also, here's how pathParse works.
https://github.com/paulirish/infinite-scroll/blob/master/jquery.infinitescroll.js#L57-62

from infinite-scroll.

benoon avatar benoon commented on April 27, 2024

i tried something like that:

pathParse : '?page=1',

but it's still the same. Loading ?page=2 as a first one.

"by default, infinite scroll only loads on the first page, not any other paged result. is there a reason why would want to do that?"
not really understand your question. I also want it to improve so believe me I will stay here and will answer any question if understand :)

right now I am going to prepare an example on clean drupal installation just for you to look at.

from infinite-scroll.

lukeshumard avatar lukeshumard commented on April 27, 2024

Try pathParse : '?page=0',

from infinite-scroll.

commodoreforce avatar commodoreforce commented on April 27, 2024

up?

from infinite-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.