Skip to content

Instantly share code, notes, and snippets.

@josefglatz
Last active January 6, 2024 14:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josefglatz/16ae96456c16d5cbe90d030adbe12130 to your computer and use it in GitHub Desktop.
Save josefglatz/16ae96456c16d5cbe90d030adbe12130 to your computer and use it in GitHub Desktop.
TYPO3 Fluid Easy Modulo (with ext:vhs)
<f:if condition="{i.cycle -> v:math.modulo(b: 3)} === 0">
<div class="break-lg-up"></div>
</f:if>
<!-- without the last item -->
<f:if condition="({i.cycle -> v:math.modulo(b: 3)} === 0) && (!{i.isLast})">
<div class="break-lg-up"></div>
</f:if>
@ute-arbeit
Copy link

You don't need vhs, just use the modulo operator
<f:if condition="({i.cycle} % 3 === 0) && (!{i.isLast})">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment