Support Forums

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro visibility of reset button

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Björn Dammann
    #105019

    Hi, I can’t find anything in the search.

    Is it possible to have the reset button show only after submitting something? So if the Filter is not in use there is no reset button?

    I tried to look for a css class in the wrapper like .searchandfilter-on (and if not in use .searchandfilter-off) so I could target the button via the wrapper class.

    Trevor Moderator
    #105034

    Hi

    You could use PHP to see if the results are filtered, like this (change the ID number for yours):

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1234)->current_query();
    if (($sf_current_query->is_filtered())||($sf_current_query->get_search_term()!="")) {
      // do something that identifies a search has been made (set some CSS, ...)
    }
    // your normal template code here
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.