orchardcms - Orchard infinite scroll -


i trying use "infinite ajax scrolling" orchard module.

https://gallery.orchardproject.net/list/modules/orchard.module.orchard.jquery.ias

i installed module through admin interface. made necessary modifications described on given link. also, had modification described in comments.

the infinite scrolling thing not functioning. created 30 blog posts in order test it. when scroll through blog posts through public website, first page og blog posts loaded , when scroll bottom, nothing happens. pager not visible (expected), no new content appended bottom of list (not expected).

when scroll through blog posts using admin interface , scroll down sufficiently, chrome console reports couple of things:

uncaught error: syntax error, unrecognized expression: <!doctype html>  <html lang="en-us" class="static orchard-blogs">  <head>      <meta charset="utf-8" />     <title>proba - manage infinite blog</title>      <link href="/orchardlocal/modul...<omitted>...l> jquery-1.9.1.js:4421 sizzle.error jquery-1.9.1.js:4421 tokenize jquery-1.9.1.js:5076 select jquery-1.9.1.js:5460 sizzle jquery-1.9.1.js:3998 jquery.fn.extend.find jquery-1.9.1.js:5576 jquery.fn.jquery.init jquery-1.9.1.js:196 jquery jquery-1.9.1.js:62 jquery.fn.jquery.init jquery-1.9.1.js:201 jquery jquery-1.9.1.js:62 (anonymous function) jquery.ias.min.js:210 fire jquery-1.9.1.js:1037 self.firewith jquery-1.9.1.js:1148 done jquery-1.9.1.js:8074 callback 

a moment after:

get http://localhost:30321/modules/orchard.jquery.ias/styles/images/loader.gif 404 (not found) jquery-1.9.1.js:6469 jquery.extend.buildfragment jquery-1.9.1.js:6469 jquery.extend.parsehtml jquery-1.9.1.js:531 jquery.fn.jquery.init jquery-1.9.1.js:149 jquery jquery-1.9.1.js:62 get_loader jquery.ias.min.js:266 show_loader jquery.ias.min.js:279 paginate jquery.ias.min.js:167 scroll_handler jquery.ias.min.js:99 jquery.event.dispatch jquery-1.9.1.js:3074 elemdata.handle jquery-1.9.1.js:2750 

in admin interface checked blog properties , seems configured fine. default values in place [container, item, pager, nextanchor], , these values present in html file i'm viewing when reported errors occur.

edit (after justrhysism's answer)

after implementing justrhysism's answer, focused on why infinite scrolling works in dashboard not in front-end. when opened list of blog posts in dashboard, located .pager element.

<ul class="pager">     <li class="first"><span>1</span></li>     <li><a href="/orchardlocal/admin/blogs/42?page=2">2</a></li>     <li class="last"><a href="/orchardlocal/admin/blogs/42?page=2">&gt;</a></li> </ul> 

i opened list of blogs in front-end, , located .pager element.

<ul class="pager" shape-id="92" style="display: none;">     <li class="first" shape-id="92"><span shape-id="93">1</span></li>     <li shape-id="92"><a href="/orchardlocal/new-infinite-blog?page=2" shape-id="95">2</a></li>     <li shape-id="92"><a href="/orchardlocal/new-infinite-blog?page=2" shape-id="98">&gt;</a></li>     <li class="last" shape-id="92"></li> </ul> 

then inspected javascript in charge triggering async loading of content.

function paginate(curscroffset, oncompletehandler)         {             urlnextpage = $(opts.next).attr("href"); // evaluates $(".zone-content .pager .last a").attr("href")             ...............         } 

and found out urlnextpage variable gets set undefined in front-end view.

problem

i've come across before. it's document parsing error. there whitespace character (of description) @ top of document orchard returns instead of <! expected. more knowledge of ajax , document parsing better describe this.

solution

to fix this, find view document.cshtml within orchard's core (located in src\orchard.web\core\shapes\views) , copy theme's view directory.

in file, line 10 <!doctype html> starts. above this, remove line break between closing brace } , doctype declaration.

before:

} <!doctype html> 

after:

}<!doctype html> 

this should fix issue.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -