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

Support archive

pre search output

Ross Hulford 17 Mar 2014 09:30 question, complete

When I go to my page before I hit the sumbit button I get the whole unfiltered results output.

my search code,

http://pastie.org/8937369

Also if I have no resultsI still get my table headers. How can I make sure the headers are only visible if there is at least one result and I do not get any results until the form is posted. Thanks.

Replies

  1. Low 17 Mar 2014 09:33

    Put the headers in a conditional, like so:

    {exp:low_search:results ... } 
    {if count == 1}
    HEADER
    {/if}
    ... single search result ...
    {if count == total_results}
    FOOTER
    {/if}
    {/exp:low_search:results}

  2. Ross Hulford 17 Mar 2014 14:29

    still getting the results output as soon as I go to my page

    loginarea/training

  3. Low 17 Mar 2014 14:30

    Are you encoding the query or using GET variables?

  4. Ross Hulford 17 Mar 2014 14:43

    using GET for testing, is that a problem?

  5. Low 17 Mar 2014 15:01

    No, but if there is no query string in the URI when using GET variables, then all (non-filtered) entries will be displayed. And the query="" param will be ignored.

    You can use an {if current_query_string} ... {/if} conditional around the whole Results tag to make sure it only shows the Results if a query string is present.