0

I'm quite new to ee3/Low Search and I'm wondering if someone would mind helping?

I'm attempting to give a site a simple property search.

On my site index page I have a select with property type options(categories)like House, Apartment, Land etc. inside the Low form tag.

If the "House" category is selected and posted to the results page I would like a form containing only House-specific fields to be displayed and if the "Land" category is posted I would like to display a form containing only Land-specific fields.

What would be the best way for me to do this?

Thanks

  • "House" and "Land" you describe above is categories or category Group ? – Mufi - Amici Infotech Feb 13 '17 at 12:31
4

To identify the categories selected in low search, we use low search variable low_search_category

  1. In low search form, You need to select your query {exp:low_search:form query="{segment_3}"}

  2. Use low_search_category to identify category you searched.

    <select name="category[]" id="type" class="form-control selectpicker show-tick" title="Choose One" data-live-search="true" data-style="btn-primary">
        <option value="">Choose Type</option>
        {exp:channel:categories channel="channel_name" disable="category_fields" category_group="1" parent_only="yes" style="linear"}
        <option value="{category_id}" {if low_search_category ~ '/\b'.category_id.'\b/'}selected{/if}>{category_name}</option>
        {/exp:channel:categories}
    </select>
    

    In above example, I have use low_search_category to make the selection field selected. In the same manner, you can use this variable to identify your category in {if} or can pass in categories loop.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.