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.
Comments
Comment #1
thecodecutter CreditAttribution: thecodecutter commentedI 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.
Comment #2
Remon CreditAttribution: Remon commentedThanks Nick for figuring this out :)
Comment #3
Remon CreditAttribution: Remon commentedas per #740686: Integrate semantic views Semantic Views has been merged into views!
Comment #4
Remon CreditAttribution: Remon commentedThis is irrelevant now, since Semantic Views is a part of views styles.
Comment #5
BarisW CreditAttribution: BarisW commentedNot 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.
Comment #6
BarisW CreditAttribution: BarisW commentedChanging it to D7.
Comment #7
BarisW CreditAttribution: BarisW commentedI 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.
Comment #8
torgosPizzaAdding the code from #7 worked for me in 6.x as well. Thanks!
Comment #9
chunty CreditAttribution: chunty commentedDoes this fix also work for D6?
Comment #10
torgosPizza@chunty: Yes. See my previous comment in #8
Comment #11
Ken Hawkins CreditAttribution: Ken Hawkins commentedWorking 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.
Comment #12
dale386 CreditAttribution: dale386 commentedHere's a patch for anyone who needs it.
Comment #13
dale386 CreditAttribution: dale386 commentedCorrecting previous upload to conform with naming conventions.
Comment #14
thejtate CreditAttribution: thejtate commentedThanks @dale386, works like a charm.
Comment #15
sidharth_k CreditAttribution: sidharth_k commentedThe 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.
Comment #16
sidharth_k CreditAttribution: sidharth_k commentedComment #17
forestmars CreditAttribution: forestmars commentedWorks as expected.
Comment #18
AnybodyWell 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()
Comment #19
Honza Pobořil CreditAttribution: Honza Pobořil as a volunteer commented7.x-1.x will receive no work. Migrate to 7.x-2.x.