0

I'm trying to spit out a table with first column being the # of row basically. However my {count} keeps resetting for each field loop. I need my count to stay the same

I have a VM Chosen field that I first loop through to display rows of all players in that field. I use {count} and works fine. Then I loop through a grid field and list out all players from that but the {count} resets to 1 because it's a new loop. I have all this wrapped inside a channel entries tag with limit="1" to a specific entry_id.

Can you create a variable and increment it in EE without a plugin? I've never used Stash but it sounds like that would be a solution?

2
  • If your using grid have u tried grid:coumt ? May 4, 2017 at 12:27
  • ya but that would still start at 1. I just realized I could probably use PHP to set a variable and increment it I bet.
    – Chief
    May 4, 2017 at 12:35

1 Answer 1

1

yes.. Php was the way to go here in the template. I created a php variable set to 1 and then within each loop I just incremented it and spit out the php variable so it kept a 1-10 list and never reset

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.