MODX Community

String Output Modifiers: What is modulus (mod)?

I’m unfamiliar with this term. What does this modifier do?

Here’s an example of it in usage within a chunk tpl for a getImageList:


What is this supposed to be doing?


The modulo operation returns the remainder of a division of 2 integers.
So in this case, if [[+idx]] is 0, 4, 8, 12, … the remainder is 0 and </div><div> gets written (probably to create a layout with 4 columns).