Forums Forums Search & Filter Pro Limit search results before filtering

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #190343

    Hello,

    I’d like to limit what’s visible before and after filtering. Is there a way to set a class for before and after filtering? Or is there something in place already?

    I don’t want all results to be invisible before filtering, only some (those with a certain class that I’ve set).

    Thanks.

    Trevor
    #190348

    What Display Results method are you using? What is the class that you have set, and are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #190350
    This reply has been marked as private.
    Trevor
    #190382
    This reply has been marked as private.
    Anonymous
    #190384
    This reply has been marked as private.
    Trevor
    #190388
    This reply has been marked as private.
    Anonymous
    #190402
    This reply has been marked as private.
    Trevor
    #190444
    This reply has been marked as private.
    Anonymous
    #190495

    Perfect, that works. Thank you very much!

    For others, the answer was to add the following lines in the results.php, which adds a “not-sf-filtered” or “sf-filtered” class:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1075)->current_query();
    if (!$sf_current_query->is_filtered()) {
      $is_filtered = " not-sf-filtered";
    } else {
      $is_filtered = " sf-filtered";
    } ?>
    
    <div class="content-width<?php echo $is_filtered;?>">
Viewing 9 posts - 1 through 9 (of 9 total)