Forums Forums Search & Filter Pro Refresh the active query object with AJAX filtering

Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #150781

    I have a Search & Filter Pro search form set up using a Post Type Archive and loading with AJAX. Searching and filtering is working great ????

    I would like to show the list of the active terms using the info in the Accessing the Search Data article.

    I am able to access and display the current active data, but it does not update when a new term is selected and new results are loaded with AJAX. It only updates when I refresh the page.

    Is there a way to update the accessible search data upon Ajax load, in addition to page load?

    Thanks!

    Trevor
    #150803

    If you are running the PHP inside the page or results template, the PHP needs to be run INSIDE the code that outputs the Ajax container. Does that help?

    Anonymous
    #151119

    haha yes. That makes total sense, and it’s working as expected now. I was testing the output at the top of the file without thinking about where the results refresh…

    One more thing… I would like to wrap the label and term in markup. Is there a way to return the label and term values separately?
    For instance, echo $sf_current_query->get_field_string("_sft_location"); returns “Location: Africa”, but I would like it to read <dt>Location:</dt><dd>Africa</dd>.

    Thanks!

    Trevor
    #151132

    I am not sure. IF it is possible, it would be using the Filter Input Object filter.

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