Forums › Forums › Search & Filter Pro › Ajax search results with > divi plugins, Portfolio Posts Pro
Tagged: Divi Salvattore Lightbox
- This topic has 9 replies, 2 voices, and was last updated 7 years, 6 months ago by
Anonymous.
-
Anonymous(Private) October 2, 2017 at 4:38 pm #134357
Hello again, you’ve been helping me sort and filter blog posts with the Divi theme and it works great. Your help has been amazing.
I’ve added a plugin called Portfolio Posts Pro (https://diviplugins.com/downloads/portfolio-posts-pro/) which lets me open Divi posts in a lightbox. I added the ‘et_pb_salvattore_content’ class to the plugin module. This works very similar to the built in Divi Blog module, as well as the built in Divi Filterable Portfolio module and the results are sorting properly etc.
The lightbox works fine on the initial page load. It opens with an animation over the search results with a close button.
Once you’ve applied the search filter to the page, the lightbox opens to a new URL, and you have to use the back button, losing all previous search results.
I wonder if there’s a quick way to make sure the lightbox always opens over the search results page and not to a new URL…
I hope that makes sense.
Trevor(Private) October 2, 2017 at 4:46 pm #134362Ah, if you look at the script part of my setup for Divi, there are two lines that reapply Salvattore. You need some code on the new lines straight after those two lines to reapply the code for your lightbox. You may need to ask the author, something like, ho do I reapply the lightbox after Ajax runs? Show them the script you have so far (my script).
Anonymous(Private) October 10, 2017 at 1:54 pm #135695Thanks Trevor, I’ve contacted Divi support as well, inquiring how to reapply their lighbox after ajax runs, but I don’t think they understood the ask. I’ve resubmitted my ticket, attempting a better explanation and hoping for a better outcome… We will see.
Anonymous(Private) October 11, 2017 at 3:29 pm #135934Hi Trevor just to resolve this thread, Divi gave me the following addition to your code and it seems to be working correctly
et_pb_image_lightbox_init($( '.et_pb_lightbox_image'));
:<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax complete"); var grids = document.getElementsByClassName('et_pb_salvattore_content'); salvattore['register_grid'](grids[0]); salvattore['recreate_columns'](grids[0]); et_pb_image_lightbox_init($( '.et_pb_lightbox_image')); }); }(jQuery));</script>
Thanks for your help!!
-
AuthorPosts