Since i work with Grid format for courses, i wanted to remove the course sections from the navigation menu.
Wrote a small js script that takes care of that (not tested everywhere yet, but works fine for me).
Important to reiterate this is for Moodle 3.2 with boost theme, and Grid course format.
Add it to "Site administration" -> "Appearance" -> "Additional HTML" inside the "Before BODY is closed" section:
<script>
var listGroup = document.getElementsByClassName("list-group")[0];
var listGroupItems = listGroup.getElementsByClassName("list-group-item")
for (var itemKey = 0; itemKey < listGroupItems.length; itemKey++) {
var dataKey = listGroupItems[itemKey].getAttribute("data-key");
if (dataKey == "mycourses") { break; }
if(/^\d+$/.test(dataKey)) {
listGroupItems[itemKey].style.display = 'none';
}
};
</script>
ATTENTION! this script also removes the "private files" nav topic in all pages that aren't courses since its data key is a number(5) but that could easily be fixed with a simple "if" (i happen to not need "private files" as well so this works for me)