Forums › Forums › Search & Filter Pro › Filter not working
Tagged: filter
- This topic has 25 replies, 3 voices, and was last updated 5 years, 3 months ago by Anonymous.
-
Trevor(Private) August 7, 2019 at 10:32 am #218315
I have made a change to the Ajax Container in the form.
In the page, see this shortcode element:
https://www.screencast.com/t/BAL1kvYAHG
Can you edit that to make it only:
[searchandfilter id="2415"]
Then, add a text element directly above the results grid, and in the text tab (not the visual tab) of that Text element, paste this:
[searchandfilter id="2415" action="filter_next_query"] <script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ elementorFrontend.hooks.doAction('frontend/element_ready/posts.classic', jQuery('.elementor-widget-posts')); }); }(jQuery));</script>
This still might not work for Ajax refresh, as the script was designed for normal Elementor Grid Blocks, not those from Anywhere Elementor. But some progress will have been made, I hope.
Anonymous(Private) August 7, 2019 at 8:37 pm #218427No dice – I had to deactivate WordFence to mitigate a server 403 error.
For the sake of testing, I just added an Elementor Grid – and still no deal with and without text element.
Right now, I have a custom search with both search codes showing.
[searchandfilter id=”2415″]
[searchandfilter id=”2415″ action=”filter_next_query”]Anonymous(Private) August 8, 2019 at 4:54 pm #218517The good: It seems to be working
The bad: This shows up on the frontend(function ( $ ) { “use strict”; // detects when the ajax request has finished and the content has been updated // re-init the layout scripts from Elementor $(document).on(“sf:ajaxfinish”, “.searchandfilter”, function(){ elementorFrontend.hooks.doAction(‘frontend/element_ready/posts.classic’, jQuery(‘.elementor-widget-posts’)); }); }(jQuery));
Trevor(Private) August 8, 2019 at 5:03 pm #218519Somehow the script tags have been removed is my guess. I cannot edit the page right now, as you have it open.
The Text element has a visual and a plain text tab, and the script must be entered in the plain text and it must be saved with that open. If you save it in the visual mode, elementor will strip the tags.
Anonymous(Private) August 8, 2019 at 9:27 pm #218539Trevor,
If I wanted to expand this solution to AE Block templates – how would I?
The Elementor solution works fine – but limited by the way Elementor handles an Archive listing.
AE allows me to build this in a very different, dynamic way.How would I adapt your solution – via -:
1) Ajax container class to
2) JS scriptI assume I would need another Search Form specific to AE.
Again, thank you for your support.
-
AuthorPosts