Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Show popular tags

Started by carlos 8 years ago · 0 replies · 681 views
8 years ago

Hello to All,

I would like to restrict the number of tags showed in the side bar. I would like show only the most 10 tags used. How I could modify the loop, in the following code snippet, to do that?

Any clue would be very appreciated, I don't have experience in twig.

Thanks in advance
Carlos.

TWIG
{% if taxlist %}
   <div class="tagcloud">
{% for tax,value in taxlist[taxonomy] %}
   <a href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax|e('url') }}">{{ 
   tax|capitalize }} </a>
{% endfor %}
   </div>
{% endif %}

Suggested topics

Topic Participants Replies Views Activity
Support · by Supple, 4 hours ago
0 13 4 hours ago
Support · by TomW, 10 hours ago
2 32 7 hours ago
Support · by TomW, 4 days ago
3 140 2 days ago
Support · by TomW, 4 days ago
2 94 2 days ago
Support · by TomW, 1 week ago
6 167 5 days ago