Thank you very much for this great module. As issues like #999890: Determine compatibility with Semantic Views module there is high demand for a hook in views_plugin_pager_infinite_scroll::render() to make the switch statement more flexible and expendable.

The current implementation looks like this:

function render($input) {
    global $base_url;
    $content_selector = '';
    $style_options = $this->view->style_options;
    $items_selector = '';
    $img_path = $base_url . '/' . drupal_get_path('module', 'views_infinite_scroll') . '/images/ajax-loader.gif';
    dsm($this->view->plugin_name);
    switch ($this->view->plugin_name) {
      case 'default':
        $content_selector = 'div.view-content';
        $items_selector = '.views-row';
        break;
      case 'grid':
        $content_selector = 'div.view-content > table > tbody';
        $items_selector = 'tr';
        break;
      case 'list':
       if (array_key_exists('wrapper_class', $style_options) && !empty($style_options['wrapper_class'])) {
         $wrapper_class = '.' . $style_options['wrapper_class'];
       } else {
         $wrapper_class = '.item-list';
       }
       $content_selector = 'div.view-content>' . $wrapper_class . ' > *';
        $items_selector = '.views-row';
        break;
      case 'table':
        $content_selector = 'div.view-content > table > tbody';
        $items_selector = 'tr';
        break;
    }
    $pager_theme = views_theme_functions('views_infinite_scroll_pager', $this->view, $this->display);
    return theme($pager_theme, array('tags' => $input, 'quantity' => $this->options['items_per_page'], 'view_name' => $this->view->name, 'current_display' => $this->view->current_display, 'content_selector' => $content_selector, 'items_selector' => $items_selector, 'img_path' => $img_path, 'element' => $this->options['id']));
  }

But for example to make the module compatible with https://www.drupal.org/project/views_responsive_grid we need to add handing for other view display plugins like this:

      // Make compatible with responsive grid
      case 'responsive_grid':
        $content_selector = 'div.view-content > .views-responsive-grid > .ms-grid';
        $items_selector = '.ms-grid__item';
        break;
      // Make compatible with responsive grid END

As this should never be hacked into the module like above and in #999890: Determine compatibility with Semantic Views module this function clearly needs a hook.

Is there an active maintainer willing to add a hook and having ideas for the HOW or what can we do to implement a clean solution as soon as possible?

Comments

Anybody created an issue. See original summary.

Honza Pobořil’s picture

Status: Active » Closed (outdated)
Anybody’s picture

Hi Bobik, you changed the status to outdated. Why? Has this hook already been implemented?
Would be nice to learn about the reasons. I tried to describe the reasons for my request.

Honza Pobořil’s picture

Hi, it is outdated because 7.c-1.x is not maintained anymore.

If this issues is valid is some supported branch mark it like this. But realistically do not expect maintainers will work on it. :-/

Anybody’s picture

Yes I can confirm this is outdated in 7.x-2.x - all that code was removed. Thanks a lot!