Collapsed Topic Formats - Start Expanded

Collapsed Topic Formats - Start Expanded

by Kyle Smith -
Number of replies: 9
Hi All, Wondering if there is a way that I can set my collapsed topics to start expanded and then miniamise like normal? Cheers
Average of ratings: -
In reply to Kyle Smith

Re: Collapsed Topic Formats - Start Expanded

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Kyle,

Assuming you are using the latest version for Moodle 2.x+ and not using persistent cookies to store the toggle state beyond the session.  Then edit 'module.js' and change all of the '0's to '1's for the variable 'toggleBinaryGlobal' around line 32.  This should give you:

var toggleBinaryGlobal = "11111111111111111111111111111111111111111111111111111";

where the string is 53 '1's.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapsed Topic Formats - Start Expanded

by Kyle Smith -

That's Awesome! Cheers!

On a more complicated level - is it possible to set it so the current topic is expanded?

In reply to Kyle Smith

Re: Collapsed Topic Formats - Start Expanded

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Kyle,

Not complicated ;) - the code already does it.  Just make sure you designate the current topic with the 'light bulb' and upon refresh it will open.  Please let me know if yours is not working - if so as much info about your installation would be useful.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapsed Topic Formats - Start Expanded

by Brad White -

Hey Gareth,

I'm looking for an option very close to this but I'm looking to have specifically only 2 topics by default open at the top. I changed the global topic binary global numbers the first 2 from 0 to 1 hoping that the first two topics would then change to toggle. No luck. Am I missing something with cookies?

In reply to Brad White

Re: Collapsed Topic Formats - Start Expanded

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Brad,

Nope!  The snag is that as the code is JavaScript it is cached by Moodle and you need to do a 'Site Administration' -> 'Development' -> 'Purge All Caches' for any changes to have an effect (This only needs to be done once after a change).

However, if you are using a Moodle 2 version you may have to remove some user preferences in the database and change some code in 'renderer.php'.  If you could tell me what version of CT you are using '$plugin->version' value in 'version.php' then I could tell you the specific changes.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapsed Topic Formats - Start Expanded

by Brad White -

Our version is $plugin->version = 2011120914

I would appreciate if you could point me to where exactly in renderer.php I would have to make some changes. 

In reply to Brad White

Re: Collapsed Topic Formats - Start Expanded

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Brad,

My bad, but I made several releases on that version, please could you tell me the value of '$plugin->release' as that is really unique!

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Collapsed Topic Formats - Start Expanded

by Brad White -

$plugin->release = '2.2.1.1'

 

In reply to Brad White

Re: Collapsed Topic Formats - Start Expanded

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Brad,

Make the '111000...' change at the very beginning of 'lib_min.js'.  'lib.js' is there for reference.  If you want to use 'lib.js' and make the changes there you can but you need to change line 31 of 'format.php' too.

Cheers,

Gareth