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)