moodle-format_flexsections
moodle-format_flexsections copied to clipboard
No visible summarytext on some / most sections displayed as link
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
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>
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