Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Show popular tags

Started by carlos 7 years ago · 0 replies · 380 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 Thomas, 1 week ago
2 57 14 hours ago
Support · by Anna, 3 days ago
2 65 17 hours ago
Support · by Justin Young, 18 hours ago
1 33 18 hours ago
Support · by Duc , 1 week ago
2 68 5 days ago
Support · by Colin Hume, 1 week ago
2 60 6 days ago