What did I do wrong with the list counter?

This is what I use:

<$list filter="[range[4]]" variable="outer" counter="outnbr">
<$list filter="[range[7]]" variable="inner" counter="innbr">
<<outnbr>>:<<innbr>> {{{ [<outnbr>pad[3]] [[/]] [<innbr>pad[3]] +[join[]] }}}<br> 
</$list>
</$list>

This is what I get. (The outer counter does not appear in the filter join. It seems to be nullified.)

  • Note the counter appears before the filter, so it is available.
  • Note this happens regardless of whether it is the list counter or the list variable.

1:1 /001
1:2 001/002
1:3 001/003
1:4 001/004
1:5 001/005
1:6 001/006
1:7 001/007
2:1 002/001
2:2 /002
2:3 002/003
2:4 002/004
2:5 002/005
2:6 002/006
2:7 002/007
3:1 003/001
3:2 003/002
3:3 /003
3:4 003/004
3:5 003/005
3:6 003/006
3:7 003/007
4:1 004/001
4:2 004/002
4:3 004/003
4:4 /004
4:5 004/005
4:6 004/006
4:7 004/007

However, if I switch up the padding to make the numbers different, then it works:

<$list filter="[range[4]]" variable="outer" counter="outnbr">
<$list filter="[range[7]]" variable="inner" counter="innbr">
<<outnbr>>:<<innbr>> {{{ [<outnbr>pad[3]] [[/]] [<innbr>pad[2]] +[join[]] }}}<br> 
</$list>
</$list>

Both numbers appear when they are not identical.

1:1 001/01
1:2 001/02
1:3 001/03
1:4 001/04
1:5 001/05
1:6 001/06
1:7 001/07
2:1 002/01
2:2 002/02
2:3 002/03
2:4 002/04
2:5 002/05
2:6 002/06
2:7 002/07
3:1 003/01
3:2 003/02
3:3 003/03
3:4 003/04
3:5 003/05
3:6 003/06
3:7 003/07
4:1 004/01
4:2 004/02
4:3 004/03
4:4 004/04
4:5 004/05
4:6 004/06
4:7 004/07

Filter syntax automatically “de-duplicates” list items.

Thus, when the outer number is “001” and the inner number is also “001”, you only get one of them.

To prevent de-duplication, you can add an “=” prefix to the affected filter runs, like this:

{{{ =[<outnbr>pad[3]] [[/]] =[<innbr>pad[3]] +[join[]] }}

enjoy,
-e

2 Likes

ok, thank you. I had never seen that before.

Definitely felt like some voodoo at first.

(I was just onto the realization that it was duplication, but it would have taken me much longer to figure out the equals signs syntax.)