moodle-format_flexsections icon indicating copy to clipboard operation
moodle-format_flexsections copied to clipboard

No visible summarytext on some / most sections displayed as link

Open VOOM108 opened this issue 1 year ago • 1 comments

In a new course on a new Moodle 4.1 out of the 5 sections that are displayed as links, only the first .course-content-item-content.collapse has a class of .show - I tried to remove the .collapse:not(.show) { display: none; } but since I cannot find a way to discern sections that are displayed on the course page from those displayed as links, that would remove the summarytext etc. from the sections that are to be displayed on the course page as well.

The class .show seems to be used for the expandable sections, but it should be added to all sections that are links, which it is not.

Plugin Version is: 4.0.6 2023122300

VOOM108 avatar Jan 22 '24 14:01 VOOM108

I made a workaround, but it would be better to solve this natively of course.

<script>
document.addEventListener('DOMContentLoaded', function() {
    document.querySelectorAll('.flexsections > li').forEach(function(li) {
        // Check if the li element does NOT contain a collapsible toggle
        if (!li.querySelector('.course-section-header > div > div > a[data-toggle="collapse"]')) {
            // Find the .course-content-item-content within the li and add the 'show' class
            var contentItem = li.querySelector('.course-content-item-content');
            if (contentItem) {
                contentItem.classList.add('show');
            }
        }
    });
});
</script>

VOOM108 avatar Jan 22 '24 17:01 VOOM108

Hello, thanks for the report. This is a duplicate of https://github.com/marinaglancy/moodle-format_flexsections/issues/68 , please follow the original issue for the discussion

marinaglancy avatar Oct 02 '24 20:10 marinaglancy