Skip to content

Instantly share code, notes, and snippets.

@jasonvarga
Created August 30, 2013 00:20
Show Gist options
  • Save jasonvarga/6384974 to your computer and use it in GitHub Desktop.
Save jasonvarga/6384974 to your computer and use it in GitHub Desktop.
Even/Odd statement in Switchee and IfElse
<h2>IfElse</h2>
{exp:channel:entries channel="blog" dynamic="no"}
{exp:ifelse parse="inward"}
{if "{switch='odd|even'}" == "odd"}
<b>{title}</b><br />
{if:else}
{title}<br />
{/if}
{/exp:ifelse}
{/exp:channel:entries}
<h2>Switchee</h2>
{exp:channel:entries channel="blog" dynamic="no"}
{exp:switchee variable="{switch='odd|even'}" parse="inward"}
{case value="odd"}
<b>{title}</b><br />
{/case}
{case value="even"}
{title}<br />
{/case}
{/exp:switchee}
{/exp:channel:entries}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment