CMS Development

Marius
Participante | Parceiro Platinum
Participante | Parceiro Platinum

Change the order of listing on HubL function

resolver

Hi, currently i display the list of topics by doing this:

 

<ul>
{% set blog_topics = blog_topics('testing blog', 250) %}
{% for item in blog_topics %}
<li class="hs-menu-item hs-menu-depth-1">
<a href="{{ group.absolute_url }}/topic/{{item.slug}}">{{ item }}</a>
</li>
{% endfor %}
</ul>

The problem is that this will display the list of topic by  descending order but i want  ascending order. Is there anyway to do that?

 

And other question about the first parameter of 

blog_topics('testing blog', 250)

 Is it the name of the blog cause when i change that to whatever, it still works well with my current blog.

0 Avaliação positiva
1 Solução aceita
JasonRosa
Solução
HubSpot Employee
HubSpot Employee

Change the order of listing on HubL function

resolver

Hey @Marius If you wanted to reverse the order of the topics in your example you could use the reverse HubL filter (http://designers.hubspot.com/docs/hubl/hubl-supported-filters#reverse) on the for loop or you could look into using the HubL sort filter as well (http://designers.hubspot.com/docs/hubl/hubl-supported-filters#sort). I hope that helps! 

Exibir solução no post original

1 Resposta 1
JasonRosa
Solução
HubSpot Employee
HubSpot Employee

Change the order of listing on HubL function

resolver

Hey @Marius If you wanted to reverse the order of the topics in your example you could use the reverse HubL filter (http://designers.hubspot.com/docs/hubl/hubl-supported-filters#reverse) on the for loop or you could look into using the HubL sort filter as well (http://designers.hubspot.com/docs/hubl/hubl-supported-filters#sort). I hope that helps!