Topic on Extension talk:CollapsibleSections

51.6.65.80 (talkcontribs)

Thank you so much for creating this extension, it seems to be the best solution so far.

I have run into a problem though, which is that the last header that is collapsible will collapse all other headers into it.

Eg. I want to collapse h5's, meaning that every element that is sub-h5 level should collapse (h6 and p elements). Instead, the extension will collapse everything under the h5, even if there is an h2 coming. This makes it practically unusable for anything other than h2s. Any thoughts on how to fix this? Thanks

Tosfos (talkcontribs)

Thank you for the kind words. I'm not so clear on what you're attempting to do. And is it only the last heading that's the issue, but the other headings work as expected? It sounds like you might want to set:

$wgCollapsibleSectionsTag = 'h5';

If I'm off base here, please post any configuration for this extension from your LocalSettings.

51.6.65.80 (talkcontribs)

@Tosfos, thank you for the quick reply.

I believe my LocalSettings are set correctly:


wfLoadExtension( 'CollapsibleSections' );

$wgCollapsibleSectionsEnableDesktop = TRUE;

$wgCollapsibleSectionsTag = h5;


To explain it again, let's say my page looks like this:


<body>

    <h2>

        <h5>

            <p></p>

        </h5>

        <h5>

            <p></p>

        </h5>

    </h2>

    <h2>

        <p></p>

    </h2>

</body>


The h5s are collapsible. The first h5 collapses correctly. When I collapse the second one, I would expect only the <p> to collapse, but instead it collapses the next h2 into it too. I hope that makes sense, and I hope it can be fixed.

Tosfos (talkcontribs)

Can you check which version of the extension and which version of MediaWiki you are using? By the way, you should put quotes around 'h5', but it won't make much of a difference for this issue.

51.6.65.80 (talkcontribs)

I´m using Mediawiki 1.36.1, and extension version 0.01 for MW 1.36.

I added the quotes, thank you.

Tosfos (talkcontribs)

We'll see if we can reproduce the issue. Feel free to ping me if you don't hear from me soon.

Tosfos (talkcontribs)

Noting that we are researching this now.

Tosfos (talkcontribs)

The issue should be fixed now. Please note that this extension only officially supports LTS versions of MediaWiki, but it likely is compatible with 1.36.


Please test and mark as resolved.