All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Conditional Globa Variable

Dave 13 Sep 2013 11:38 question, complete

Hi Low,

For my entries I have the fieldtyope date which of course is a Low Envent fieldtype.
Right now all my entries have date, but I don't want to show a date on every entrie but would realy like to use only one channel for these kind of entries.

So I was thinking coould I create an new foeldtype, a checkbox with yes or no. and use this in the template written as a conditionall global variable.

So if the checkbox is set to 'no' no date will be printed and when set to yes a date will be printed. Is this possible and what would the condional statement look like.

Something like??
{if {date_required} == "yes"} <p>{datum:start_date}</p> {/if}

Replies

  1. Low 13 Sep 2013 11:47

    Sure, that would work. Just like any field, really. But use this as the conditional:

    {if date_required == 'yes'} ... {/if}
    Note the variable doesn't have the curly brackets inside the if-statement.

  2. Dave 13 Sep 2013 11:57

    Thanks Low.