Theming

Twig for Loops and Inline if Syntax

Last updated
Categories
Sprout Video

Our products are printing out a bit weird right now because they’re floating, but not breaking correctly. To fix this, we need to wrap every three products in their very own row. In this tutorial, you will use a "divisibleby" test to see if the item number we’re on is divisible by three, and then loop through them. We'll also clean up our if statement for our background color, by implementing an inline if syntax.