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

Support archive

Low Variables + Conditionals?

Clearbold, LLC 24 Aug 2010 18:39 question, complete

Is it possible with Low Variables (1.2.5, EE 2.1) to check to see if the variable is empty? I.e.,

{if {my_variable}!=''}My variable: {my_variable}{/if}

In the examples, the <br /> in this line would be output if the variable was empty, which would be undesirable:

&lt;span class="fn"&gt;{low_contact_fn}&lt;/span&gt;&lt;br /&gt;

Thanks,
Mark

Replies

  1. Low 24 Aug 2010 19:50

    Hey Mark,

    At the moment, you can only use vars in conditionals if you enable early parsing for those variables. Use syntax like you would with segment variables, like this:

    {if my_variable != ''}my conditional stuff{/if}

    I'm working on allowing conditionals using the {exp:low_variables:parse} template tags.

    JB 9 Mar 2017 15:32

    Is this documented some place? I am using the last legacy version and I am trying to check if a grid has any rows...

    Low 13 Mar 2017 12:02

    Only possible with a full tag, as mentioned in the second example here: http://gotolow.com/addons/low-variabl...

  2. Clearbold, LLC 25 Aug 2010 13:57

    Thanks for adding support in v1.3.1. Works great!