[SOLVED] {{ episode.categories.count }}


#1

Hi, might be a very noob-question, but why can’t I get the amount of categories for an episode with that code:

{% for episode in podcast.episodes %}
   {{ episode.categories.count }}
{% endfor %}

I expected to see e,g, a “2” printed out when I have two categories assigned. Instead I get nothing. When I iterate through episode.categories and print the category.slug, I can see the names. So in general it’s working.


#2

It’s done via length:

http://twig.sensiolabs.org/doc/filters/length.html