Template: How do i add a list of used categories

A forum for Bolt related questions / issues

Template: How do i add a list of used categories

Postby rduinmayer » Tue Feb 11, 2014 3:48 pm

Template: How do i add a list of used categories?

I want to add a list of categories on the right side of my website. Like:
Category 1 (3 posts)
Category 2 (1 post)
Category 3 (16 posts)

etc...

How can i manage this in bolt?

===

Thanks in advance.
rduinmayer
 
Posts: 2
Joined: Tue Feb 11, 2014 3:43 pm

Re: Template: How do i add a list of used categories

Postby Logfather » Wed Feb 12, 2014 9:15 pm

Good question really. I think it would be great if a list of used categories was added to Bolt documentation or even the standard theme.

I did find on this page http://twig.sensiolabs.org/doc/tags/for.html how to count the records in an array. I haven't found a nice way to display it yet though, this returns the number of records but does so for every single record ;)
Code: Select all
 {% for record in records %}
          {{ loop.length }}
        {% endfor %}
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam


Return to Bolt Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron