Topic Collapsable Module

Re: Topic Collapsable Module

by Gareth J Barnard -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear KerryJ,

Thank you for the appreciation smile.

Unfortunately, there is not an easy workaround.  The closest solution I have managed to get to following your suggestion is to create a named tag and then have a label with a tag of the following:

<a Xonclick="toggleexacttopic(document.getElementById('section-7'),document.getElementById('sectionatag-7'),'7',false);" href="#namedtag">Go to named tag</a>

Where '7' is the toggle number and 'namedtag' the anchor.  Clearly this is complex and indeed if the destination toggle is open will then close it.  The best solution would be to provide a Javascript function that just takes the toggle number and does the rest including checking to see if the toggle section is already open.  And at the same time add a generated 'name' attribute to the toggle's 'a' tag so that for instance the following could be added if desired:

<a href='#ct7' Xonclick="opentoggle('7'); return false'">Click me</a>

 Note: The editior on the forum is adding an 'X' in front of the 'a' tag 'on click' attribute.

This would be a little work and I want to complete an existing issue first and then migrate to using Git for source control.  However if you need the functionality quickly,  I would do it if I was paid (I'm an impoverished student ;) ) on the basis that the improvement was allowed to be added into all versions beforehand.

Cheers,

Gareth