• Resolved maria_wp

    (@maria_wp)


    I tried the following shortcode:

    [su_accordion]
    [su_spoiler title=”Top level spoiler title (spoiler 1)”]
    [_su_accordion]
    [_su_spoiler title=”spoiler 1 – sub-spoiler 1″] Content [_/su_spoiler]
    [_su_spoiler title=”spoiler 1 – sub-spoiler 2″] Content [_/su_spoiler]
    [_/su_accordion]
    [/su_spoiler]
    [su_spoiler title=”Top level spoiler title (spoiler 2)”]Content[/su_spoiler]
    [/su_accordion]
    

    And would expect that the nested accordion would work, i.e. when I click on sub-spoiler 1 it opens and clicking on sub-spoiler 2 the other will close and the current will open. But that is not the case. Both are open i.e. the [_su_accordion] is not recognized. I could see as well the shortcode directly in the HMTL.

    Is there a way to fix it?

    • This topic was modified 5 years, 7 months ago by maria_wp.
Viewing 1 replies (of 1 total)
  • Thread Starter maria_wp

    (@maria_wp)

    I inspected the code more closely and found that the tag

    [_su_accordion]

    is not translated properly, i.e. it doesn’t insert a

    <div class="su-accordion">

    If I add this manually to

    [su_accordion]
    [su_spoiler title=”Top level spoiler title (spoiler 1)”]
    <div class="su-accordion">
    [_su_spoiler title=”spoiler 1 – sub-spoiler 1″] Content [_/su_spoiler]
    [_su_spoiler title=”spoiler 1 – sub-spoiler 2″] Content [_/su_spoiler]
    </div>
    [/su_spoiler]
    [su_spoiler title=”Top level spoiler title (spoiler 2)”]Content[/su_spoiler]
    [/su_accordion]

    than everything is working. Perhaps the code could be fixed as well???

Viewing 1 replies (of 1 total)
  • The topic ‘Nested accordions don’t work’ is closed to new replies.