I am creating a website for an apartment complex where the user can find apartments based on a floorplan. I have Low Search installed and am attempting to create a filtered search form using categories assigned to each apartment.
Question: is there a way to combine multiple categories into one option in a select dropdown? For example, I have six categories (floor 1, floor 2, floor 3, floor 4, floor 5, floor 6).
I want two select options where each option returns results for three of the six categories. If you choose the first option, it will return results for entries categorized with floor 1, floor 2 or floor 3. If you choose the second option you get entries categorized with floor 4, floor 5 or floor 6.
I've tried the following, within a Low Search form tag:
<label>What floor do you like?</label>
<select name="category[]">
<option value="">--</option>
{exp:channel:categories
category_group="1"
show="1|2|3"
style="linear"
}
<option value="{category_id}"{if low_search_category ~ '/\b'.category_id.'\b/'} selected{/if}>
I'm afraid of heights, lower floors are preferred
</option>
{/exp:channel:categories}
{exp:channel:categories
category_group="1"
show="4|5|6"
style="linear"
}
<option value="{category_id}"{if low_search_category ~ '/\b'.category_id.'\b/'} selected{/if}>
The higher the better!
</option>
{/exp:channel:categories}
</select>
But what displays in the select dropdown is:
--
I'm afraid of heights, lower floors are preferred
I'm afraid of heights, lower floors are preferred
I'm afraid of heights, lower floors are preferred
The higher the better!
The higher the better!
The higher the better!
I am on EE 2.8.1 with Low Search 3.5.2. Any insight provided would be most appreciated!