0

Working in octoberCMS, followed a few video and got the blog plugin up and running no problem. The only area that not really talked about that I just wanted to ask was how to get the paging feature working with the Rain labs blog plugin.

http://students.cnawebdev.org/DG309/2170/successwithtess/index

Sandbox for playing with October, but if you scroll down to the bottom you can see if the pager which isn't working. So any advice would be great for anyone that used the CMS or plugin before.

Smot
  • 23
  • 6
  • 1
    It's common for people who are new to the site to ask questions and then never accept an answer. As a result, their newer questions tend to be ignored. Reputation points are the currency of this site, and accepting an answer is like tipping a waiter/waitress :-) please valid my anwser if it was resolving your question – Pierre-André Vullioud Mar 13 '16 at 21:04

1 Answers1

2

Usually on an home page, you don't have pagination. You can show the last 4 post with a link to the Blog page

Use the blogPosts component to display a list of latest blog posts on a page.

see documantation here : https://octobercms.com/plugin/rainlab-blog

title = "Accueil"
url = "/"
layout = "default"
is_hidden = 0

[blogPosts]
pageNumber = "{{ :page }}"
postsPerPage = 4
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = "actualite"
postPage = "blog-detail"

==
{% set posts = blogPosts.posts %}

{% for post in posts %}
            <div class="col-sm-3 col-xs-6">
                <figure>
                        <a href="{{ post.url }}"><img
                            data-src="{{ first.filename }}"
                            src="{{ post.featured_images[0].thumb(250, 166) }}"
                            alt="{{ first.description }}"
                    /></a>

                    <figcaption class="bordered no-top-border">
                        <div class="info">
                            <h5><a href="{{ post.url }}">{{ post.title }}</a></h5>
                            <p class="info">
                                {{ post.published_at|date('d.m.Y') }}
                            </p>
                        </div><!-- /.info -->
                    </figcaption>

                </figure>
            </div><!-- /.col -->
            {% endfor %}
<a href="{{ 'blog'|page }}">All blog posts</a>

I hope this can help you