0

I'm trying to get this to display a the total results of a count just once. So if there are 120 results, have it output "120". Instead it shows each line 1,2,3,etc. and count == "1" displays nothing.

{if count == 0}
{exp:channel:entries channel="people" search:people_alpha="={segment_3}" orderby="people_lname" sort="asc"}
<h3>{absolute_count}</h3>
{/exp:channel:entries}
{/if}

Thanks in advance for any help on this

  • Do you have another exp:channel:entries tag wrapping this one? Because you shouldn't. Please, give us more code. – Robson Sobral Nov 12 '15 at 23:02
2

The variable which returns the total amount of entries is {absolute_results}, not {absolute_count}.

{exp:channel:entries channel="people" search:people_alpha="={segment_3}"}
    {if count == 1}
    <h3>{absolute_results}</h3>
    {/if}
{/exp:channel:entries}
| improve this answer | |
1

I can't tell because you didn't post enough code, but it looks like you have a {exp:channel:entries} loop inside of another loop, possible another channel loop. This isn't going to fly; the parse order of the templating engine won't render the output you want properly. You need to extract that inner loop and put it in an embed.

http://ee2docs.com/templates/embedding.html

An embed allows your inner loop to be parsed separately from the outer loop.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.