How to link to a collapsible topic

How to link to a collapsible topic

by Mikael Elmolhoda -
Number of replies: 1
Hi, I'm trying to create a link that links to a collapsible topic and opens that topic, that is, collapses it.

My URL ends with course/view.php?id=91#section-1 but it stays uncollapsed until the user clicks on topic. How to fix this?
Average of ratings: -
In reply to Mikael Elmolhoda

Re: How to link to a collapsible topic

by Philipp Memmel -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
From Moodle 4.2 onwards you can add the expandsection=x param to force the section x to show expanded, where x is the section number which you want to show expanded, see MDL-75542. It work for topics and weeks format, other course formats however maybe have not implemented this (yet), if they have their own logic of when to show a section collapsed and when not.
Average of ratings: Useful (1)