I am using Views 3 alpha 3. My site has 47 pages. I set Infinite Scroll to display 1 page. Scrolling works correctly when I scroll down past the first 'page'. When I then scroll down the 'second' and subsequent page the scrolling seems to loop and serves up page after page. Using firebug I can see as I scroll down the page a new div 'view view-news view-id-news view-display-id-page_1 view-dom-id-1' being created for each 'page' and within that div a news div 'views_infinite_scroll-ajax-loader' plus another new div 'view view-news view-id-news view-display-id-page_1 view-dom-id-1' also for each page. It is this extra div that looks odd to me as I now have a set of divs with the same name as their parent.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thecodecutter’s picture

I don't have a solution yet but I have determined that the issue is being caused by me using Semantic Views in my Views Styles settings. When I switch to any of the standard styles it works correctly. That is, Unformatted, Table, Grid, HTML List all work.

Remon’s picture

Title: Scrolling never stops » Determine compatibility with Semantic Views module
Category: bug » task

Thanks Nick for figuring this out :)

Remon’s picture

as per #740686: Integrate semantic views Semantic Views has been merged into views!

Remon’s picture

Status: Active » Closed (won't fix)

This is irrelevant now, since Semantic Views is a part of views styles.

BarisW’s picture

Status: Closed (won't fix) » Active

Not really true, just a small part of Semantic Views is integrated in Views. We still use Semantic Views (yes, there is a D7 module for it!) for all our projects, as it offers more fine-grained control and, for instance, the possibility to generate a Definition List (<dl><dt>Term</dt><dd>Data></dd><dd>Data2</dd></dl>).

So re-opening this, and hoping for someone to fix the problem with Semantic Views.

BarisW’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Changing it to D7.

BarisW’s picture

Status: Active » Needs review

I checked the code. By adding the following lines of code to line 44 of views_plugin_pager_infinite_scroll.inc, the module will also work with Semantic Views.

      case 'semanticviews_default':
        $content_selector = 'div.view-content';
        if ($this->view->style_plugin->options['list']['element_type']) {
          $content_selector .= ' ' . $this->view->style_plugin->options['list']['element_type'];
          if ($this->view->style_plugin->options['list']['class']) {
            $content_selector .= '.' . $this->view->style_plugin->options['list']['class'];
          }
        }
        $items_selector = 'div';
        if ($this->view->style_plugin->options['row']['element_type']) {
          $items_selector = $this->view->style_plugin->options['row']['element_type'];
          if ($this->view->style_plugin->options['row']['class']) {
            $items_selector .= '.' . $this->view->style_plugin->options['row']['class'];
          }
        }
        break;
torgosPizza’s picture

Adding the code from #7 worked for me in 6.x as well. Thanks!

chunty’s picture

Does this fix also work for D6?

torgosPizza’s picture

@chunty: Yes. See my previous comment in #8

Ken Hawkins’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Working for us with latest infinite scroll and semantic views.

Just wasted an hour tracking this down, can we get this committed?

Happy to roll a patch if need be -- code from #7 just needs to go into "function render($input) {"

Setting to major given that semantic views is somewhat popular.

dale386’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.39 KB

Here's a patch for anyone who needs it.

dale386’s picture

Correcting previous upload to conform with naming conventions.

thejtate’s picture

Thanks @dale386, works like a charm.

sidharth_k’s picture

The patch in #13 works well. However I've made some changes so that its a bit more robust

- Deal with cases when users may specify multiple classes for the list class/the row class in the semantic views settings (In that case the patch in #13 would give the wrong selector). This patch simply takes the first class
- Also pass the class name through drupal_clean_css_identifier() as semantic views does the same. So if you had a class name class abc__123, patch #13 would not work because the class name would be converted to abc--123 but the patch would still use pick up abc__123 as selector

There is still one known limitation. This patch (and the previous ones) will not work in the scenario where "#" would be used in the class name

P.S. I seemed to have uploaded the patch twice and now I don't know how to remove it from the comment. Both files are the same.

sidharth_k’s picture

forestmars’s picture

Status: Needs review » Reviewed & tested by the community

Works as expected.

Anybody’s picture

Well the patch will work but from my point of view this is a bit against Drupals modular concept because it "hacks" the module with knowledge from a different module.

On the long view it would be better and "The Drupal way" to have a hook in the render() function, wouldn't it?
Such a request can be found here: #2642548: Add hook for views_plugin_pager_infinite_scroll::render()

Honza Pobořil’s picture

Status: Reviewed & tested by the community » Closed (outdated)

7.x-1.x will receive no work. Migrate to 7.x-2.x.