Forums Forums Search & Filter Pro Highlighting (not filtering) results

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #247744

    Hi,

    I have a custom need for displaying the results – I want to display all the initial results even after the filters are applied, but just highlight the ones that are matches.

    This highlighting could of course be as simple as just adding a class or something to the ones that match – this would all be done through ajax.

    Do you think this is possible?

    Ross Moderator
    #247785

    Hi Robin

    That might be tricky but possible…

    My approach would be:

    1) Use the shortcode method, and follow the instuctions about copying results.php in to your child theme folder
    2) In results.php, edit the template, so you grab all the IDs of the results, and put them in a hidden input variable – don’t display these results in any other way
    3) Write your own WP_Query in the results template, that fetches all the posts (I’m assuming you want to grab a sepcific post type, so write a query that returns the full result set)
    4) Use Javascript to read the IDs from the hidden input field, and do the highlighting etc to the full results set
    5) For ajax integration, you can use our JavaScript eventsf:ajaxfinish, to update your classes used for highlighting the results

    I hope that makes sense – its only theory but I don’t see why it wouldn’t work – I would be careful though how many results you plan to load in at the same time (large number will increase page load speed)

    Thanks

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