Results appear only on submit

Forums › Forums › Search & Filter Pro › Results appear only on submit

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #116167

    Hi there,
    I would like to have the search and submit button alone on the page and when the search is submitted the results appear underneath. At the moment the results are always there. Is there a way to do this without leaving the page? I am displaying the results as shortcode.

    Trevor
    #116180

    Hi

    You need to make sure that you have followed the Customization guide here.

    Edit the results.php file like this (where 1234 is changed for the actual ID of your form):

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1234)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      // any other message here if no search has been made (can be empty)
    } else {
      // your results.php code here
    }
    Anonymous
    #116287

    Thanks that worked perfectly

Viewing 3 posts – 1 through 3 (of 3 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.