Skip to content

Instantly share code, notes, and snippets.

@nathanpitman
Last active August 29, 2015 14:28
Show Gist options
  • Save nathanpitman/984030fd5d5cf6799b1d to your computer and use it in GitHub Desktop.
Save nathanpitman/984030fd5d5cf6799b1d to your computer and use it in GitHub Desktop.
ExpressionEngine switch, always be closing (Feature Request)
{exp:channel:entries}
{switch values='<div class="row">||'}
<div class="col-md-4">
{sn_programme_block}
</div><!-- / .col-md-4 -->
{switch values='||</div><!-- / .row -->' closing='</div><!-- / .row -->'}
{/exp:channel:entries}
@nathanpitman
Copy link
Author

"closing" parameter allows you to pass a value that a switch loop should always close with if the last 'switch group' is not equal to the number of switch values provided. i.e. in the case above if there were 1 or 2 results in the last switch group the closing would never be applied.

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