ExpressionEngine / ExpressionEngine

ExpressionEngine is a flexible, feature-rich, free open-source content management platform that empowers hundreds of thousands of individuals and organizations around the world to easily manage their web site.

Home Page:https://expressionengine.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

count and total_results not working in {categories} loop

ic360-com opened this issue · comments

I'm trying to use the {count} an {total_results} variable within a {categories} loop, but both values are always rendering as '1'.
FYI: This is an Embedded template.

{categories} {count} {total_results} {/categories}

EE 6.4.17 and 7.4.6
PHP 7.4 and 8.1

@ic360-com sorry for the delay!
I think you're getting the results from your {exp:channel:entries} loop, you'll need to use these variables instead -

{categories}
    {category_count}
    {category_total_results}
{/categories}

Here's the ExpressionEngine docs page for the {categories} variables