This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

01garant62848
01garant62848

Does somebody has implemented a Rainlab Blog Category AJAX filtration? I've found only questions how to implement this on RainLab's Blog GitHub, but no answers were provided. Also no any tutorials found regarding this topic. It seems that everyone wants this feature but no one shares it :)

Categories are filtered with this approach:

{% for category in categories %}
 <li {% if category.slug == currentCategorySlug %} class="active control" {% endif %} data-filter=".{{ category.name }}">{{ category.name }}</li>
{% endfor %}

and standard pagination

<div class="blog-pagination">
 {% if posts.lastPage > 1 %}

<ul class="pagination">
         {% if posts.currentPage > 1 %}

    <li>
        <a href="{{ page.baseFileName|page({ (pageParam): (posts.currentPage-1) }) }}">&larr; Prev</a>
    </li>
         {% endif %}

        {% for page in 1..posts.lastPage %}

    <li class="{{ posts.currentPage == page ? 'active' : null }}">
        <a href="{{ page.baseFileName|page({ (pageParam): page }) }}">{{ page }}</a>
    </li>
        {% endfor %}

        {% if posts.lastPage > posts.currentPage %}

    <li>
        <a href="{{ page.baseFileName|page({ (pageParam): (posts.currentPage+1) }) }}">Next &rarr;</a>
    </li>
        {% endif %}

</ul>
{% endif %}

</div>

it only filters posts which are shown on a current page, posts from other pages are not shown (and this is a big issue)

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.