I love the functionality of this module, but instead of auto-loading subsequent pages of content, i want user to have to click a "show more" button to load content, rather than auto-loading.

The use case is because the content of this view is not the final element of the page.
In other words, users need to be able to scroll PAST the view and see stuff below it, without having to wait for ajax to load all the rest of the pages.

Comments

aaronbauman’s picture

Title: Optional "show more" button instead of auto-loading subsequent pages. » Add an option to manually load subsequent pages, instead of automatically scrolling based on window scroll
Status: Active » Needs review
StatusFileSize
new6.08 KB

According to some other comments, this was supposed to be written already, but I couldn't find it anywhere.
On top of that the "manual example" on the example website was not, in fact, manual.
Here's a patch that applies to the latest DEV.

  • Adds a checkbox "Load subsequent pages manually instead of automatically"
  • Adds a text input to give the "next" button a different label, defaults to "Show More"
  • Adjusts theme and javascript accordingly
quadbyte’s picture

Thanks Aaron for this excellent feature addition, just tested your patch and it's working fine.
However I found a way to improve it a little by simply changing the button label option key from "manual_load_label" to "text" which seems to be more compliant with Views and allowed me to get support for arguments title; i.e I needed the label to read "Show more sports", "Show more politic" automatically.

quadbyte’s picture

Fixed a typo in views_plugin_pager_infinite_scroll.inc
$options['maunal_load'] = array('default' => 0);
Should be
$options['manual_load'] = array('default' => 0);

Also my previous comment was not really accurate, the change from 'manual_load_label' to 'text' is not necessary I was mislead by some side effect with some existing customization we had on our site, sorry about that.

ChrisConolly’s picture

any chance of this feature making an appearance on Drupal 7?

betovarg’s picture

Hi guys, im a total newb at patching. Is there anyway someone can point me to a downloadable module that has this patch applied?
Does anyone know if this will make it into the module?

Thanx

bryancasler’s picture

Great patch, sorely needed functionality.

codigovision’s picture

Thanks for the patch, this is exactly what I was looking for! I made a small addition to wrap the button in a div with id so it can be easily styled in the theme.

Just added this to views_infinite_scroll.js:

$(next_el).wrap('<div id="views_infinite_scroll_button" />');
codigovision’s picture

Here's the patch, adapted from #3

sarath.rajan’s picture

Is there any patch for D7? :(

GloryFish’s picture

I rolled a patch based on comment #8 for Drupal 7, it's here: #1942142: Patch to manually load subsequent pages for Drupal 7

jmuzz’s picture

jmuzz’s picture

My bad.

  • Sam152 committed 830f280 on 7.x-1.x
    Issue #1335792, Issue #1316194 - AJAX compatability, manual load button.
    
sam152’s picture

Thank you for the patch, this fix has been fixed in the last dev release and will likely be tagged in a stable release over the next few weeks.

  • Sam152 committed 830f280 on 7.x-2.x
    Issue #1335792, Issue #1316194 - AJAX compatability, manual load button.
    
joseph.olstad’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Fixed

Fixed in 7.x-1.2-dev , if you need this functionality, upgrade to 7.x-1.2-dev

Status: Fixed » Closed (fixed)

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