New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL structure for the nextSelector link #5
Comments
Hey pewpew, This is true.. I think we could do two things...
I'd love your help with either. Could I set you up with access to the site? |
omg! I should have read this issue before diving into the source code... It would be better if the loading mechanism simply worked with a link that exist in each page. Then, it'd be possible to integrate this plugin without worrying about the url structure. There might be many cases where it is not possible to modify the URL (ie. large media organizations using static publishing). |
gercheq, so the plugin does its best to guess what the story with the URL structure is. that way you dont have to specify and thus... this ticket :) |
Paul, I'd definitely be happy to help with it! Let me kick around a few ideas today and I'll post back here with them. |
Can we close this issue now Paul? It seems you can define your own path details. |
Hi, "Here is a patch to the jquery version which does not try to guess/calculate the next page, but actually reads it from the the next link from the content returned from ajax. " Is there something I need to do in my config? My next links look like <a href='/infinite?start=10' class='ditto_next_link'>Next ></a> Is there a config option that activates reading the next page in order to get the link? Thanks |
there is. you can use pathParse option now to define how the plugin reads your page structure. i'll try and get a demo of this for the new site. |
I made my own modifications at https://github.com/Cipa/infinite-scroll The thing I could not make, is get the IS page counter inside pathParse as a global variable. Basically the first next link specifies the number of items per page, so I have to save it somehow and reuse it by multipling it with the page number Maybe it's possible with the current code but I might have missed something |
This pathParse needs some documentation. What, exactly, is supposed to be passed to pathParse? |
pathParse should be a function. There will be new documentation coming soon! |
To clarify further, pathParse should be a function that returns your path, which is an array of what goes before and after your next page number. For example, if your next page url is |
Nope, totally closed...unless someone else wants to add something to this? |
This isn't necessarily functionality-related, but a coworker of mine this morning had a difficult time getting the plugin working until he realized that the URL passed to the nextSelector has to pass a specific regex in order for the plugin to operate as intended. Specifically in the determinePath function, it's literally looking for a url that has some sort of number representing the next page (i.e., '/page/2/' or 'page=2'), as opposed to what he was doing which was the starting item # (like 'start=51').
I think if the documentation on the project website had just a sentence describing what the URL must contain in order for it to function properly, that'd clear things up a lot. And please ignore this ticket if that sentence is there already, but I couldn't find it after a quick read-through of http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/
The text was updated successfully, but these errors were encountered: