Listing categories with post count in a nav? I'm trying to list my categories (and sub categories, just one sub level) as a nav, and have the number of entries in each of those categories beside each one.

There is another question on here which achieves a simple list here but trying to apply that logic to what i have for my nav is scrambling my brain as everything I've tried throws an error.

This is what i have, taken from the Get Help section of the craft site:

&lt;ul&gt;
{% nav category in craft.categories.group('articleCategories') %}
    &lt;li&gt;
        &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
        {% ifchildren %}
            &lt;ul&gt;
                {% children %}
            &lt;/ul&gt;
        {% endifchildren %}
    &lt;/li&gt;
{% endnav %}
&lt;/ul&gt;


Any thoughts on how i can get the number of entries each category has in it, in this?
Within you nav loop, you would use the method total() with an craft.entries ElementCriteriaModel, to only count the entries that are related to the category you're looping. Pass the CategoryModel to the relatedTo parameter.

{% nav category in craft.categories.group('articleCategories') %}

    {# Get the count of entries related to `category` #}
    {% set entryCount = craft.entries.relatedTo(category).total() %}

    {{ entryCount }}

{% endnav %}