CMS Development


Sort filter with pagination

Is there any current work to remedy the sort and then allow pagination out of the box or are hacks still the standard? To be clear when you use the |sort filter, pagination for a blog or assuming any other type of page, break. I think we can use a lazy load instead of pagination but would like both sort and pagination to work together without a hack. That being said does anyone have the code for the hack? Thanks

0 Me gusta
3 Respuestas 3
Asesor destacado

Sort filter with pagination

Hi @kyl3, (thanks @sharonlicari) what are you trying to sort by? Date or alphatbetically, or something else?

Participante | Partner nivel Platinum
Participante | Partner nivel Platinum

Sort filter with pagination

Hi @piersg , me too is having the same issue like @kyl3 . Pagination make the sort breaks when we are trying to sort based on updatedDateTime. 
Any thoughts of this? (Of course, without using Hubspot API :D)

{% if contents %}
        {% set sorted_contents = contents|sort(True, False, 'updatedDateTime') %}
        {% for content in sorted_contents %}
          <div class="col-12 col-lg-4 mb-4 post-item">
            <div class="card">
              <div class="card-header">
                <a href="{{ content.absolute_url }}">
                  <img src="{{content.featured_image}}" alt="{{ }}" class="card-img" />
              <div class="card-body">
                <h3 class="card-title">
                  <a href="{{ content.absolute_url }}"
                    >{{ }}</a
                <p class="card-text">
                  {{ content.post_list_content|striptags|truncate(200, True, "...") }}
                <a href="{{ content.absolute_url }}" class="read-more"
                  ><span class="decoration-underline">{{button_caption}}</span>
                  <span class="decoration-none">&#10230;</span></a
        {% endfor %}
      {% endif %}
0 Me gusta
Administrador de la comunidad
Administrador de la comunidad

Sort filter with pagination

Hi @kyl3 


Thank you for reaching out.


This link could give you an idea of how to start. I'll also tag a few experts that can share some ideas.


Hi @piersg @Anton @tette_engage any thoughts?




Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !

0 Me gusta