Reverse count with paginated entries? I have this loop

{% paginate craft.entries.section('sermons').limit('10') as pageInfo, entries %}

        {% for sermon in entries %}
        ...
        {{ loop.revindex }}
        ...
        {% endfor %}


That outputs a count from 10 to 1 - however, there's more entries than just the 10.

How can I output the count of what would be absolute total results?
You already pass the array keys into the loop as a variable pageInfo. There's a couple of properties you can access from it, see the Craft docs:

Templating Reference → {% paginate %}

Of interest for you is probably these:


  pageInfo.total – The total number of elements across all pages
  pageInfo.currentPage – The current page number.


It looks like there's no property for the "current element number" and you need to do some math to output it:

{% paginate craft.entries.limit(10) as pageInfo, pageEntries %}    
    {% for entry in pageEntries %}

        {% set index = (pageInfo.currentPage - 1) * 10 + loop.index0 %}

        {{ pageInfo.total - index }} of
        {{ pageInfo.total }}

    {% endfor %}
{% endpaginate %}