I want to implement infinite scrolling in the BlogHolder, I've tried this using the Infinite-Scrolling jQuery plugin found at http://www.infinite-scroll.com/ even though I follow the common instructions to setup the plugin, its not working at all. Can someone give an idea how to get it to work or give me a similar solution for Silverstripe that works(I have attached the Jquery plugin). Thank you
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I've forked infinite scroll myself in order to fix this, as we're having the same issue.
I've added an option called currPageIncrement in state, so that you can pass whatever number you need to make it work, the code is here:
Hi! Can someone help me with this? I'm getting a "Sorry, we couldn't parse your Next (Previous Posts…, and kindly ask for help at infinite-scroll.com." error and don't know how to get it work.
I think a link to the SS site using this plugin will be enough, but if you like to examine the code, here it goes.
SS 3.0.5
JS:
// infinite scroll
$('#content.PortfolioHolder').infinitescroll({
navSelector : "#pagination",
nextSelector : "#pagination a#next",
itemSelector : "#content article.thumb",
debug : true,
dataType : 'html',
}, function(newElements){
window.console && console.log('context: ',this);
window.console && console.log('returned: ', newElements);
});
HTML:
<section id="content" class="PortfolioHolder">
<article class="thumb">Blah...</article>
<article class="thumb">Blah...</article>
<article class="thumb">Blah...</article>
<section id="pagination">
<a id="next" href="http://localhost:8888/hopa/portfolio/?start=4">Next</a>
</section>
</section>
Nevermind...
I have found another solution.
Infinite Ajax Scroll
JS:
// infinite ajax scroll
jQuery.ias({
container : '#content.PortfolioHolder',
item: 'article.thumb',
pagination: '#pagination',
next: '#pagination a#next',
loader: '<img src="' + $('base').attr('href') + 'themes/hopa/img/loader.gif"/>',
triggerPageThreshold: 2,
onRenderComplete: function(){ $(window).trigger('resize'); },
history : false,
});