• TortugaRanger

    (@tortugaranger)


    Hi Phil,

    Love your Accordion Blocks but have run into a compatibility problem using them within BasePress which is a knowledgebase plugin that I use extensively.

    In short, the accordion does not function when included within a BasePress custom post (article).

    I’ve been in contact with the BasePress developer who is very helpful/responsive to issues and quick to provide fixes if/when he can.

    He writes…

    I have tested the plugin and it doesn’t work because it expects the element it generates to be in a specific hierarchy.
    Yet BasePress Table of Contents adds extra elements around the headings for its own functioning.
    These extra elements break the Javascript used by the accordion plugin.
    There is not much we can do but you should ask the developers of the accordion block if they can make their Javascript less strict on the elements structure.
    If you show them the two example pages they would easily see what I mean. There is a JS error in the browser console that points to the code that doesn’t work in this use case.
    
    I hope this helps!
    
    Elio
    [email protected]

    He adds….

    Hi Morten,
    
    just to add to my previous email, this is what could be changed to the Accordion plugin to make it work.
    
    file: accordion-blocks.js
    at line 31 and 140 replace the jQuery function .children() with .find().
    
    Thanks
    
    Elio
    [email protected]

    Here are 2 test links to my website. One is to a WP Page and the second is to same accordion code but in a BasePress post.

    https://tortugaaudio.com/test-accordion-blocks/

    https://tortugaaudio.com/docs/uncategorized/test-accordion-blocks-copy/

    Any help in resolving this would be most appreciated.

    Thank you in advance,

    Morten
    Tortuga Audio

Viewing 1 replies (of 1 total)
  • Plugin Author philbuchanan

    (@philbuchanan)

    Hi @tortugaranger. While changing .children() to .find() will likely address your issue, it will also break the nesting feature of the plugin (the ability to nest accordion items inside other accordion items).

    There are other ways to decouple the JavaScript from the HTML structure, but it will require a much larger restructure of the both the HTML and JavaScript. This will be a longer term project for me and I likely won’t be able to get this work done for a while. I’ve added an issue on the bug tracker if you want to track it more closely.

Viewing 1 replies (of 1 total)
  • The topic ‘Compatibility with BasePress’ is closed to new replies.