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

Support archive

Check if select item is selected in LV select field

Josh Brodleit 24 Oct 2017 20:29 question, complete

There a way to check if a select item exists in Low Variables select field in template code? I'd like to pass a variable from an embed and check if that variable is selected in a LV field. Look forward to hearing back.

Replies

  1. Low 25 Oct 2017 08:39

    Yes, should be possible. Make sure the Select variable has early parsing enabled, then you can use it in a conditional. Depending on the separator value, you could use something like this:

    {if some_var ~ '/\b'.lv_select_var.'\b/'} 
    Yes, some_var is selected
    {/if}