Websites are using a new cool way to display more content dynamically without using traditional pagers, tabs, expanding drawers, tickers, etc. Basically, they fetch more rows, renders the content and appends it to the bottom.

Examples:
http://arstechnica.com
(Scroll down to the bottom link "+ Load more stories".)

http://digg.com/software/Drupal_6_0_has_been_RELEASED_download_now
(Scroll down to the comments and click the "Show XX - XX of XX discussions" link. More comments are appended to the bottom of the list.)

Pros
- No page loads.
- Less bandwidth and processing.
- No context changes visually or scrolling the viewport. You just continue scrolling from where you are.
- The animation looks cool.

Cons
- Not helpful for SEO due to loading client-side
- Dynamic content doesn't reappear on page reload. It may be possible with some extra JS.

Is there a module that already does this with nodes or comments? How would this work in the context of views?

CommentFileSizeAuthor
#1 facebook.png10.98 KBjrabeemer
#1 facebook2.png11.36 KBjrabeemer
digg.png9.01 KBjrabeemer
ars.png35.67 KBjrabeemer

Comments

jrabeemer’s picture

StatusFileSize
new11.36 KB
new10.98 KB

Facebook also uses this for collapsed comments and their walls.

dawehner’s picture

For me such a plugin could live in contrib well. Views is currently already such a big module, so that such a fancy extension does not have to be in views core.

cerup’s picture

+1 I'd really like to see this in views or contrib.

I could see this in views as an option between pager and row fetcher.

For example, instead of using the pager, you select rows and so what would normally be returned in a pager would just be added to the bottom of the current content. Since so many sites are doing this now, I think more people would almost use this than use a pager for certain content.

cerup’s picture

Title: Add a new dynamic row fetcher » Load more sql rows through ajax (dynamic row fetcher) like Twitter, Facebook, Mahalo, etc

There currently is a module (I haven't tried it) that is 95% of what we need.

http://drupal.org/project/endless_page

It's currently been abandoned and hasn't been updated in more than a year. If we can find a new maintainer, it would be great. It already works with views and right now, but it only loads node teasers or full node (doesn't support rows/fields) when you reach the bottom of the page. I think it would be pretty easy to change the behavior and make it load new nodes when someone clicks on a button. The harder issue may be making it works with fields (not just nodes). Adding support for fields should make it significantly faster though.

In the javascript file there is:

			if($(document).scrollTop()>=(($(document).height()-$(window).height())-scrollMargin)) 
				// If scrolled further down than scrollMargin and the script is not allready loading another group and the script is not stopped, load the next group.
				if(!loadingGroup) endless_page_load();	
		} );

If this is changed to somebutton.click() it should do the page load on a button event instead. Not sure I quite have the time yet to implement this, but if I do i'll let you know; if someone else does - please share!

pribeh’s picture

Subscribing.

mburnette’s picture

Subscribing.

youkho’s picture

Subscribe

dawehner’s picture

Status: Active » Fixed

There is a project for this http://drupal.org/project/views_infinite_pager

Sure this has no code yet, but you can blaim him ;)

cerup’s picture

Thanks dereine, although I would wait to mark this fixed until there's actually code and it's confirmed that it addresses the needs.

dawehner’s picture

No.. The feature request is fixed :)You can use this module, when its ready....

jerodfritz’s picture

I've created this module and hosted the code on git
http://www.centogram.com/projects/drupal-infinite-scroll-pager-plugin-vi...

An Example can be found here
http://demo.centogram.com/infinite-scroll

cerup’s picture

Nice! You should start a module page or talk to the developer of http://drupal.org/project/views_infinite_pager

It would be nice to have a views 2.0 option though (since that's what majority of people are still on). Unfortunately I can't test since I'm not on Views 3 =\

BTW, is there an option to not make it auto-show more and use a 'more button'? Nice work!

pribeh’s picture

jerodfriz, great work on the infinite scroll module. I can see how Views 3 pluggable pager system is probably easier to work with. I've experienced some weird issues with your module but will run some more testing before I provide you with some feedback. Otherwise, I have to chime in my support for cerup's request of a "more button". If you're at all interested in considering such an addition to your module that would be most excellent. Regardless, thanks for contributing!

thebuckst0p’s picture

I created the Views Infinite Pager module, I was encouraged to do so by crell at DrupalCon, but I didn't have time during the conference to post the code. (It's currently on my blog in an incomplete state and called "Views Sliding Pager.") I've written to the creator of Endless Page to see if he's still working on that module. There's also this thread - #778128: Release Plans - about JerodFritz's Views3 plugin.
My implementation works differently than the other two -- it uses the regular pagination so there shouldn't be problems w/ fields vs nodes; it's toggled with the usual pagination buttons (reduced to one I think, I don't remember); and its for Views2. So it seems worthwhile to post it. Also I'd like to learn how to integrate with the Views UI (that's the piece currently missing), so it'll help me do that. I'll probably borrow some code for that from Endless Page.

thebuckst0p’s picture

Should the status of this be changed to "needs review" or should we move the conversation about how to handle overlaps to the Views Infinite Pager issue queue?

thebuckst0p’s picture

I posted the code, should be up as soon as the build script runs. Or download it from CVS. It's unchanged from what I put on my blog a few months ago and is still far from usable for production.
http://drupal.org/node/779264

cerup’s picture

We could probably move it to your module queue although I still wouldn't considered this 'closed' or 'fixed' until the discussion around it is done (which it's not).

It would be nice to have jerodfritz chime in and maybe get a single implementation rather than doing 2-3 versions. Maybe continue that part over at http://drupal.org/node/778128

pribeh’s picture

I think it's fair to say that we should move the discussion over to Views Infinite Pager. thebuckst0p seems willing to integrate all requests made here into Views Infinite Pager and is willing to collaborate with others. We should probably close this issue and continue discussion over there. Views issue queues are crowded enough.

dawehner’s picture

Do it if you want.

mattiasj’s picture

subscribing

jerodfritz’s picture

I added the more button as requested along with support for all display options as requested. The update also provides all configuration directly through the Views UI.

dropchew’s picture

subscrbing

deanloh’s picture

Subscribing

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Remon’s picture

FYI, I created yet another module at http://drupal.org/project/views_infinite_scroll. I know it sounds rude but guys I've applied for a CVS account for this 3 months ago :-/