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
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}}">← 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 →</a></li>
{% endif %}
</ul>
{% endif %}
{% endif %}
Try this and report back. I have not tried this fro what it's worth. :-P
Last updated
1-5 of 5