Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Show popular tags

Started by carlos 8 years ago · 0 replies · 600 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 webmasterodp, 1 week ago
4 157 6 days ago
Support · by nwhitfield, 1 week ago
2 135 1 week ago
Support · by stell, 3 weeks ago
5 369 2 weeks ago
Support · by gravinator, 1 month ago
5 559 2 weeks ago
Support · by Gravver, 3 weeks ago
6 347 3 weeks ago