Forums › Forums › Search & Filter Pro › Search filter disappear
- This topic has 9 replies, 2 voices, and was last updated 7 years, 6 months ago by Trevor.
-
Anonymous(Private) May 2, 2017 at 8:54 pm #106052
Hi,
I’m having a problem setting up the filters. Once I have selected my search criterias, the page refreshes automatically showing the results (which is correct) but I lose all filters and I can’t do other search.
It’s like if the site redirects to another page with only the results, and what I want is to update the same page with the results.
Is that possible ?
Thanks
Anonymous(Private) May 3, 2017 at 2:10 pm #106204Hi Trevor,
I think I have solved the problem using a shortcode. Now I can keep the search form and the results are shown on the same page.
However doing that I’m not able to customize the appearance of the results, they are shown like a list of posts. Is there any (easy) way to show the results in a grid ?
Thanks
Trevor(Private) May 3, 2017 at 5:26 pm #106302That page seems to work OK for me, but is not using an Ajax refresh. I must press ‘Enviar’ first. The URL does not contain the search term though. This may be because you have (and should not I think)
Maintain Search Form State
ON. Please try changing this.Trevor(Private) May 4, 2017 at 4:45 pm #106505About grids. I would need you to find some information out about the Flatsome UX Builder. It is possible a new feature in Search Filter Pro would allow a grid made by it to work directly with our filter, but …
I assume that the grid that it builds has ‘masonry’-like behaviour. Masonry/Isotope and Salvattore are the most popular commercial scripts out there used by WordPress themes. For example, Divi uses Salvattore and Avada uses Masonry. I cannot see that Flatsome uses either.
The issue with grids is when you trigger a ‘posts reload’ with our filter and Ajax, the grid script needs to re-trigger. This requires the theme author to provide that code. Then you load a script on to the page to do that. This is an example of the script required for Divi with Search & Filter pro:
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax complete"); var grids = document.getElementsByClassName('et_pb_blog_grid'); salvattore['register_grid'](grids[0]); }); }(jQuery));</script>
Where these lines are what we worked out were required to re-trigger Salvattore in Divi (Divi could not tell us, but we managed to work it out for ourselves):
var grids = document.getElementsByClassName('et_pb_blog_grid'); salvattore['register_grid'](grids[0]);
Masonry is far harder to figure and really needs the theme author to help.
-
AuthorPosts