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

Support archive

Conditional category select elements.

John Briggs 23 Feb 2013 18:44 question, complete

I have a search form with several parent categories in a select element and would like a conditional select element to show up based on the parent selection.

For example, I select Fire and Rescue. Submit. Now underneath that select element i'd like to see another select element with its child categories (1st responders, trucks, etc...)

<select name="category[]">
<option value=''>-- Select Industry --</option>
{exp:channel:categories channel="product" style="linear" category_group="2" parent_only="yes"}
<option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
{category_name} - {category_id}
</option>
{/exp:channel:categories}
</select>


and want to add something like this underneath:

{if category_id="x"}
{low code here}
{/if}

Replies

  1. Low 24 Feb 2013 10:34

    You could use the same IN syntax, for example:

    {if 10 IN ({low_search_category})} ... {/if}


    ...where 10 is the category id to check.