In short: I need to display embedded templates based on whether they are selected by checkbox on the publish page, but my code doesn't work if more than 1 is checked.
I tried using the code below to check for whether a checkbox was checked and display the template if it was. This works, unless more than one is checked off, then none display because the statement no longer validates as true.
I have one full-page template shared by 2 pages. I have one page that requires Rides, and the other requires all 3 templates.
The name of my checkbox field is choose_entries, and the options are "Rides" "Gear" "Groups".
{exp:channel:entries channel="pages" limit="1" url_title="{segment_1}"}
{if choose_entries == "Rides"}
<h2 class="section-title">Rides<span class="green"></span></h2>
{embed="views/.rides"}
<img src="content/img/bike.png" />
{/if}
{if choose_entries == "Gear"}
<h2 class="section-title">Gear<span class="orange"></span></h2>
{embed="views/.gear"}
{/if}
{if choose_entries == "Groups"}
<h2 class="section-title">Groups<span class="blue"></span></h2>
{embed="views/.groups"}
{/if}
{/exp:channel:entries}
I know there is probably a way to do it with php (but I don't write php), I would like to avoid that if possible. I was unable to find the correct php syntax to get an "if contains" type statement to work.