Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Show popular tags

Started by carlos 7 years ago · 0 replies · 542 views
7 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 complanar, 6 days ago
6 137 12 hours ago
Support · by Rick Beebe, 6 days ago
2 99 2 days ago
Support · by blu3prince, 3 days ago
0 50 3 days ago
Support · by alex, 4 days ago
2 91 3 days ago
Support · by Marcel, 2 weeks ago
1 142 3 days ago