Problem/Motivation

It is a common scenario to want to use the lightbox library Photoswipe together with Views Infinite Scroll, but Photoswipe fails when AJAX is enabled, #2869869: Photoswipe is not working properly if AJAX is enabled in a View.

Sadly, Views Infinite Scroll requires AJAX ...

Steps to reproduce

Use Photoswipe together with Views Infinite Scroll in a View, enable AJAX and see Photoswipe fail, just showing the actual image when you click on it, it is not shown in a lightbox.

Proposed resolution

Allow Views Infinite Scroll to work without AJAX enabled on the View itself.
Of course, AJAX will be used & needed in the background to load the further results automatically.

https://www.drupal.org/project/views_load_more and https://www.drupal.org/project/views_show_more offer a no-AJAX option. But it still requires clicking and the result is shown on a new page, so you might as well use the standard pager then.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

anybody created an issue. See original summary.

ressa’s picture

Thanks for creating this issue, that would be a very nice feature. Though, it looks like you still need to click "Load more" manually with https://www.drupal.org/project/views_load_more to get more results, unless I am missing something ...

ressa’s picture

Title: Allow this module to work without AJAX enabled on the view itself » Allow Views Infinite Scroll to work without AJAX enabled on the view itself
Issue summary: View changes

Updating the Issue Summary, to clarify why requiring AJAX in a View can be problematic, since Photoswipe stops working.

tjerah’s picture

I support this request too. In my case, I need the exposed filters to use the query parameters (no ajax mode). Since the Infinite Scroll works when views ajax is enabled thus the exposed filters become ajax mode too. It would be great if Infinite scroll could check if views ajax is disabled then use its own ajax.

sirclickalot’s picture

I too support this issue since we have numerous Views (e.g. Search API and Facets 2.x views) where we either cannot enable AJAX.

Enable AJAX on a Search API View using Facets 2.x results in...

{
  "message": "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 400\nDebugging information follows.\nPath: /facets-block-ajax\nStatusText: Bad Request\nResponseText: {\"message\":\"Session has not been set.\"}",
  "name": "AjaxError"
}

This means that we cannot apply the overall 'use AJAX' option to the view which means in turn that we cannot use the excellent View Infinite Scroll module which otherwise seems to work beautifully.