• Resolved DELUCKS

    (@delucks)


    Hi, Is there any way to close the course module accordions by default? Unfortunately, I didn’t find anything in your documentation.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @delucks,

    For now, collapsing course module accordions by default isn’t a core feature of the plugin. However, this plugin may have what you need. That plugin hasn’t been tested or updated in a while, so I’d say use it with caution.

    If you can drop an enhancement/feature request about this on the Sensei LMS GitHub repository, that would be great. Here’s a quick link to get you started:

    Submit New Sensei Feature Request

    Thread Starter DELUCKS

    (@delucks)

    Hi,
    Thank you! The mentioned plugin isn’t up-to-date and seems broken according to the reviewers. So, I just created a CSS-based workaround, as I’m not good at waiting:

    .sensei-collapsible__content {
    opacity: 0;
    max-height: 0;
    }

    .sensei-collapsible__content.collapsed {
    opacity: 1;
    max-height: none !important;
    }

    I’m glad to hear that you were able to find a CSS workaround. ??

    And thanks for sharing it!

    Just a slight tweak/addition here.

    With the CSS code above, the course page works fine, thank you! – however it would mess up my course navigation. I have tweaked the CSS by adding an ID to the course page I want the collapsed accordion to appear on.

    The page ID can be found when inspecting the page code, e.g. with Chrome (Developer?). For me, it looks something like <article id=”post-1890″ class=”…..>

    Of course everybody’s post ID would be different, and if you have several course overview pages, you would need to add these page IDs as well.

    With the additional IDs, the course navigation works fine now again.

    Hope that helps.

    My example now looks like this (change your ID accordingly):

    #post-1890 .sensei-collapsible__content {

    opacity: 0;
    max-height: 0;
    }

    #post-1890 .sensei-collapsible__content.collapsed {

    opacity: 1;
    max-height: none !important;
    }

    • This reply was modified 1 year, 8 months ago by sb52146.
    • This reply was modified 1 year, 8 months ago by sb52146.
    • This reply was modified 1 year, 8 months ago by sb52146.

    Hi @sb52146

    Thank you so much for sharing your code! I’m pretty sure this will be helpful in case users bump into this thread. ??

    For now, it looks like everything is all set. The thread is already marked as Resolved but if you or anyone else would like to share more CSS tweaks, you all are welcomed to mark it as Unresolved and reply here.

    Best,
    Alba

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Default close accordion’ is closed to new replies.