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

Support archive

Need help with low search! ASAP - looming deadline on major site. :(

Rebecca Chapman 25 Jul 2013 22:28 problem, complete

Need help with Low Search. I am trying to create an advanced form that isn't too advanced and i just can't seem to get it to work. My deadline is of course in the next 30 - 45 min. How's that for a panic!
I've never used low search and i wanted something to use that would be easier than the native EE advanced search. I need to search out 2 specific channels and display the results. But i need to be able to search by keyword, category or major destination.

My basic form code:
{exp:low_search:form collection="industry_partner_listings" query="{segment_3}" search_mode="all" result_page="search/results"}

Search by city or business name to find
deals in any area:

Or Search by Category

-- Select One --
{exp:channel:categories channel="industry_partner_listings" style="linear" category_group="1"}

{category_name}

{/exp:channel:categories}

Or select from one of our participating Destinations

-- Select One --
{exp:channel:entries channel="destinations" dynamic="no"}
{title}
{/exp:channel:entries}

Search

{/exp:low_search:form}

My results code: (pulled directly off the docs)
{exp:low_search:results limit="10" paginate="bottom"}
{if no_results}{redirect="search/no-results"}{/if}

{if count == 1}

    {/if}
  1. {title}

  2. {if count == total_results}
{/if}
{/exp:low_search:results}

Replies

  1. Rebecca Chapman 25 Jul 2013 22:31

    try this again:

    Form code

    {exp:low_search:form collection="industry_partner_listings" query="{segment_3}" search_mode="all" result_page="search/results"}

    <div class="col_full nobottommargin">
    <label>Search by city or business name to find<br>deals in any area: </label>
    <input type="text" name="keywords" class="input" id="keywords" />

    </div>

    <div class="clear"></div>

    <div class="col_full nobottommargin">
    <label for="template-contactform-service">Or Search by Category</label>
    <select name="name="category[]"">
    <option value="">-- Select One --</option>
    {exp:channel:categories channel="industry_partner_listings" style="linear" category_group="1"}
    <option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
    {category_name}
    </option>
    {/exp:channel:categories}
    </select>

    </div>

    <div class="col_full nobottommargin">
    <label for="template-contactform-service">Or select from one of our participating Destinations</label>
    <select name="keywords" id="keywords">

    <option value="">-- Select One --</option>
    {exp:channel:entries channel="destinations" dynamic="no"}
    <option value="{title}">{title}</option>
    {/exp:channel:entries}

    </select>
    </div>

    <div class="col_full nobottommargin">
    <button type="submit" class="btn btn-success btn-small" value="submit">Search</button>
    </div>

    {/exp:low_search:form}



    results page:


    {exp:low_search:results limit="10" paginate="bottom"}
    {if no_results}{redirect="search/no-results"}{/if}

    {if count == 1}<ol>{/if}
    <li><a href="{comment_url_title_auto_path}">{title}</a></li>
    {if count == total_results}</ol>{/if}
    {/exp:low_search:results}

  2. Low 26 Jul 2013 08:23

    Hi Rebecca,

    Sorry for not replying sooner -- it was just past midnight here when you emailed me.

    By the looks of it, you need to add the query="" parameter to the Results tag, just like you're doing with Form tag.

    Secondly, you have two input fields with name="keywords". You're only meant to have a single one, or only the last one will be used (that's how web forms work, really). Since you're saying "Or select one..." you might try and split the single form into two. That will avoid that issue.