PyroCMS infinite scrolling / pagination path issue

I'm trying to implement the infinite scroll jquery plugin ( by applying it to the blog page of a PyroCMS ( install. However, I'm running in to an issue with repeating entries as the plugin seems to assume that the pagination structure is going to be page/1, page/2 and so forth, while PyroCMS builds the URLs as page/, page/10, page/20 and so forth. Is there any way to correct this? I'm triggering the plugin using the following settings: jQuery(document).ready(function($) { $('#content').infinitescroll({ state : { currPage : "10" }, loading : { img : "/img/loading.gif", msgText : "

", finishedMsg : "All done." }, nextSelector : "div.pagination ul a", navSelector : "div.pagination", contentSelector : "#content", itemSelector : "#content div.blog_post", pathParse : ["/index.php/blog/page/", "/"] }, function() { window.setTimeout(infinite_scroll_callback(), 1); } ); }); I was thinking editing the blog module's routes file could possibly work, but I'm not sure how to restructure it to get the module to use the page number versus the quantity of blog posts when constructing the pagination URLs. The contents of the routes file is, essentially: // public $route['(blog)/(:num)/(:num)/(:any)'] = 'blog/view/$4'; $route['(blog)/page(/:num)?'] = 'blog/index$2'; $route['(blog)/rss/all.rss'] = 'rss/index'; $route['(blog)/rss/(:any).rss'] = 'rss/category/$2'; // admin $route['blog/admin/categories(/:any)?'] = 'admin_categories$1'; I think the source of the problem is that the plugin is simply expecting a different pagination structure than the CMS provides. If there's anything you can do to help, I would very much appreciate it!

以上就是PyroCMS infinite scrolling / pagination path issue的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准