ProBlog

A powerful October CMS Blog plugin. Boost your SEO with robust blogging tools by Radiantweb.

Back to ProBlog Support

vince_o
vince_o

Is there a way to override the default markup for the pagination? It doesn't seem to be coming from the blogList component markup. I could target & manipulate those elements with JS, but it seems like there should be a better way to do this. I'd imagine that it is a common enough thing to want something other than "<<" or ">>" as the text for your pagination links. Thanks!

ChadStrat
ChadStrat

Hi, I implemented the laravel pagination markup from the model. But you can also just create a custom component view and use (taken from Rainlab.blog plugin, values changed accordingly):

{% if pagination > 0 %}
            {% if blogPosts.lastPage > 1 %}
                <ul class="pagination">
                {% if blogPosts.currentPage > 1 %}
                    <li><a href="{{ this.page.baseFileName|page() }}?page={{blogPosts.currentPage-1}}">&larr; Prev</a></li>
                {% endif %}

                {% for page in 1..blogPosts.lastPage %}
                    <li class="{{ blogPosts.currentPage == page ? 'active' : null }}">
                        <a href="{{ this.page.baseFileName|page() }}?page={{page}}">{{ page }}</a>
                    </li>
                {% endfor %}

                {% if blogPosts.lastPage > blogPosts.currentPage %}
                    <li><a href="{{ this.page.baseFileName|page() }}?page={{blogPosts.currentPage+1}}">Next &rarr;</a></li>
                {% endif %}
                </ul>
            {% endif %}
        {% endif %}

Try this and report back. I have not tried this fro what it's worth. :-P

Last updated

ChadStrat
ChadStrat

updated with improvement

ChadStrat
vince_o
vince_o

Yes, that did the trick -- thanks!

1-5 of 5