How to implement a Load More pagination in news module
  • I would like implement a Load More pagination in news module but end up being confused how to implement it in fuelcms.
    I have generated the news module in CLI.
    And this is how my view for fuel/application/views/news.php:
    <section id="newsfeed" class="bg-white">
    <div class="container">
    <div class="row">
    <div class="col-md-12 no-padding" id="news-block-waterfall">
    <?php $posts = fuel_model('news', array('find' => 'all', 'limit' => 9, 'order' => 'featured, date_added desc')) ?>
    <?php if (!empty($posts)) : ?>
    <?php foreach($posts as $post) : ?>
    <div class="col-md-4 col-sm-6 news-block">
    <a class="news-block-inner" href="<?php echo $post->url; ?>">
    <span class="image" style="background-image: url(<?php echo $post->image_path; ?>);">
    <div class="thumb-desc">
    <span class="subtitle">
    <span><?=$post->tag?>. </span><?=$post->publish_date_formatted('d M Y')?>
    <span class="title">
    <?php echo $post->title; ?>
    <?php endforeach; ?>
    <div class="block-pager block-pager-load">
    <a href="#" class="btn btn-lg btn-red">Load more</a>
    <?php else: ?>
    <div class="no_posts">
    <p>There are no posts available.</p>
    <?php endif; ?>

    And here is the site reference for load more pagination in codeigniter:

    It would be great if anyone could guide me to achieve this pagination. Thanks in advance.
  • Hi admin, its been a while.
    And I still not get any idea how to implement it in fuelcms-way.
    Should I use specific controller for this kind of pagination? or can I just use the opt-in controller for this?

    It would be great if you can give some suggestions for me to start.
    Thanks in advance.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!