TYPO3 Fluid Template – wrap column elements with row tag in loop

While looping through elements in a fluid template, you can wrap for example every fourth column element with a row tag. I’m using bootstrap classes in this example.

Desired output for 7 elements


Solution within the fluid template

Solution with the extension VHS: Fluid ViewHelpers 
There is also a shorter solution without modulo but you need to install the extension VHS Fluid ViewHelpers.
More info:
https://gist.github.com/githubrsys/398e7cc380299cea712d and https://fluidtypo3.org/viewhelpers/vhs/master/Iterator/ChunkViewHelper.html

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *