Last active
October 19, 2018 12:09
-
-
Save DanLaufer/e298835dfc6d523cc05ef56db0c3c197 to your computer and use it in GitHub Desktop.
Drupal 8 - Twig - Get an Alternating Class from Paragraphs in Twig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set alternating_class = (_context.elements['#paragraph']._referringItem.getName()) % 2 ? ' teaser__container--inverse' : '' %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment