Forums Forums Search & Filter Pro Check to see if anything has been searched

Viewing 3 posts - 1 through 3 (of 3 total)
  • Anonymous
    #211823

    I have a combined Filter/Search-Bar.
    I need in my result.php a characteristic if my result is filtered/searched or not (f.e. a additional class). I can do that with this code:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1800)->current_query();
    if ($sf_current_query->is_filtered()) {
    // do something
    } else {
    // do something else
    }
        	?>

    But it works only for filters, not for the searchbar. Is there another code to check if something is searched if no filters are used?

    Trevor
    #211828

    The third line would be:

    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {

    So the first do something is if nothing has been searched.

    Anonymous
    #211838

    Really thanks, Trevor
    It works. Best and fastest support i ever had.

Viewing 3 posts - 1 through 3 (of 3 total)