Forums › Forums › Search & Filter Pro › DIVI – Blog module grid
Tagged: ajax, Divi, grid, Salvattore
- This topic has 12 replies, 2 voices, and was last updated 8 years, 7 months ago by
Trevor.
-
Trevor(Private) March 21, 2017 at 3:51 pm #98318
Hi
Can you take a look at this thread:
https://support.searchandfilter.com/forums/topic/how-do-i-stop-sf-generating-its-own-posts/
The private posts contain nothing of relevance.
Anonymous(Private) March 22, 2017 at 9:29 am #98544Hi I checked the post and problem is I’m a bit beginner with code and I prefer visual and drag and drop 🙂
I’ll try to tell you what I need in more detailed way.
1. I use DIVI theme
2. I need to display posts on non archive page with post made with divi grid module (divi shortcode via Divi builder)
3. I made grid with posts and I need to filter them on the same page
4. My page is: http://new.pravenacepu.cz/na-cepu/How should I set it up? If you want I can give you credentials.
Trevor(Private) March 22, 2017 at 2:04 pm #98642OK. We will try this by steps.
Step #1. Make a form (keep it simple for now) and set the Display Method to
Customand enter the full URL of your page as the Results URL.Step #2. Add that form to the page by using the form shortcode (paste it into whatever content module Divi has for shortcodes).
Run the page. Does the form appear? It will not work yet. If it appears, send me the link for the page so I can see.
Anonymous(Private) March 22, 2017 at 4:03 pm #98744Ok, now I created form with default setting, only set to Custom and add url http://new.pravenacepu.cz/na-cepu and inserted shortcode. Form is showing.
Trevor(Private) March 24, 2017 at 11:41 am #99184OK
Hopefully it now works. But how?
In the page (ID #78) there are three content elements above the grid:
#1 is a Code Element, containing this:
<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>This reworks the grid after filtering is done by Ajax
#2 The form shortcode:
[searchandfilter id="178"]#3 The shortcode to filter the results in the Divi query/grid:
[searchandfilter id="178" action="filter_next_query"]Then in the form.
I have set Auto Count (both settings) to
ON
The Display Results Mode is set toCustom
The Ajax container is set to.et_pb_blog_gridand, because you are searching Posts and Pages, in the Posts settings, I have excluded page ID #78 (otherwise the search form is a result in the grid!!).
Does that work OK for you, and if so, can I close this thread?
EDIT: If the above does not work, Divi have a habit of changing their code, so instead of
et_pb_blog_grid(used in the form and the javascript) try usinget_pb_salvattore_contentinstead. -
AuthorPosts