Forums Forums Search & Filter Pro Problem with collapse plugin

Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #45081

    Hi there,

    First of all, thank you for a great plugin!

    I seem to have a problem on this page: http://www.huisvanhetkindpajottenland.be/diensten/. I’m using your plugin with the Collapse-O-Matic plugin (https://wordpress.org/plugins/jquery-collapse-o-matic/).

    When the page loads, all items (custom post types) are collapsed by the Collapse-O-Matic plugin. But when I filter them on the left side with the Search Filter Pro plugin, they suddenly all get expanded. This only happens when I filter the results with Ajax, so I guess it has something to do with the Ajax load.

    I contacted the Collapse-O-Matic plugin author and got this response:

    Do you have the ability to trigger a callback function after the content is loaded dynamically? You’ll need to check with your theme or Search Filter Pro plugin to see if this is so. If not, you will have to write your own callback function, but this should not be too tricky.

    I don’t know a thing about callback functions, so I’m asking you ; )

    Thank you so much for your reply!

    Trevor
    #45108

    I have a feeling this is over my head, but this post seems to be talking about (amongst other things) this same sort of thing?

    https://support.searchandfilter.com/forums/topic/ajax-checkboxes-turn-into-an-accordion/

    Ross Moderator
    #45236

    Hey Stefaan

    I think I know the issue – when you search using ajax, the results are reloaded.

    However, in addition to this, the search form is also reloaded (for updating dynamic fields etc).

    What you will need to do is, detect when S&F has finished loading the results via ajax, and then re-apply your “Collapse-O-Matic” code to the newly loaded in results.

    We do have an event/callback for this – check the first question here for the JS event:
    http://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/

    Thanks

    Anonymous
    #45251

    Hi there Ross, thank you for reaching out!

    I just got a reply from another Collapse-O-Matic plugin author, with a javascript file I had to enqueue. Everything works perfectly now! A link in case anyone else encounters this problem: https://wordpress.org/support/topic/collapsed-text-expands-when-filtered-with-ajax?replies=5#post-8388668

    Thank you for your support!
    Stefaan

    Trevor
    #45252

    Great to see that is OK.

    Can we mark this as resolved and close the thread?

    Anonymous
    #45253

    Absolutely, thanks!

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