Collapsed Topics

Course formats ::: format_topcoll
Maintained by Gareth J BarnardGareth J Barnard
An interchangeable topic or week based format that solves the issue of the 'Scroll of Death' when a course has many topics.
Latest release:
6054 sites
149 fans
Current versions available: 24

An interchangeable topic or week (day for 2.3.1+) based format that solves the issue of the 'Scroll of Death' when a course has many topics / weeks. All sections except zero have a toggle that displays that section. One or more sections can be displayed at any given time. Toggles are persistent on a per browser session per course basis but can be made to persist longer by a small code change. Full installation instructions, code adapt-ions and credits are included in the '' file.

If you have a course with more than fifty two sections then currently the toggle persistence will not work for the fifty third section and above.  Then you need to upgrade to the Moodle 2.5 version+.


The format comes with NO support.  Please see the 'Support' section in '' file that comes with the format.  This is because the format is complex and I regret that I don't have the time / resources to freely assist with questions pertaining to specific enhancements / changes / knowledge improvement.

I will investigate genuine bugs and issue fixes in a timescale set by myself.  When reporting issues you MUST clearly state the full version and release of both Moodle and the Collapsed Topics format as contained within their 'version.php' files - if not it takes me longer to figure out, often resulting in me asking for the details anyway and slowing the process of solving your problem down.  It really helps to read the 'Reporting Issues' section in the '' file and upload and describe in detail the issue you are having on the 'Course formats' forum.


NEW: 'The Complete Guide to Collapsed Topics' (and 'Blurb') book is now available, covering: installation, upgrade, uninstallation, course and global features, resetting, capabilities, language strings, overriding icons / styles in a theme and adding a new icon set.

The Complete Guide to Collapsed Topics book

The Complete Guide to Collapsed Topics book on a book stand

Inside the Complete Guide to Collapsed Topics.

NOTE: The latest version incorporates functionality to support new UK / EU Cookie Law which is implemented as a user acceptance in the 1.9 version and no 'cookie' is used at all in 2.x versions.

Screen casts:

Privacy API support starts with V3.3.1.2 for M3.3 and V3.4.0.2 for M3.4 where the API has been implemented in the minor release of Moodle.


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7


Gareth J Barnard
Gareth J Barnard (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS


  • Wed, May 14, 2014, 11:08 PM
    Good day, I'm using this format, it runs awesome. Just a detail, when you log out the course, the opened topics stay like that, opened, so if you log in again they are opened. I want all topics to be collapsed every time you log in moodle, is there a way to do it? I think format remembers your last visit and leaves open the visited topics.

  • Gareth J Barnard
    Thu, May 15, 2014, 12:10 AM
    Hi Chris,

    You can disable toggle persistence completely under: Home -> Site administration -> Plugins -> Course formats -> Collapsed Topics as an administrator. This means that toggle state will be forgotten even on page refresh.


  • Thu, May 15, 2014, 12:22 AM
    Thanks Gareth, it works great.

    Is there a way to customize each toggle, for example, with a background image?

    Thanks 4 ur answer.

  • Gareth J Barnard
    Thu, May 15, 2014, 12:26 AM
    Hi Chris,

    Sorry, no there is not. You can only change the toggle colour on a per course basis.


  • Sat, May 17, 2014, 3:43 AM
    Gareth, good day.

    I,m really into your format.

    Is there a way to make toggles open to collapse when you open a new one?


  • Gareth J Barnard
    Sat, May 17, 2014, 7:12 AM
    Hi Chris,

    Thank you. Sorry, there is not a way without altering the way the JavaScript code works. It is conceptually possible though.


  • Mon, May 19, 2014, 9:46 PM
    i am trying to create a csv to bulk create courses in 2.6 but cannot work out what the field content will be for FORMAT field when using collapsed topics. I have tried ctopic, ctopics, collapsed topics but with no luck. Can you tell me what the correct term is for this format please?
  • Gareth J Barnard
    Mon, May 19, 2014, 9:57 PM
    Hi N Kearns,

    The Frankenstyle name is 'format_topcoll' as shown underneath the title on this page.


  • Mon, May 19, 2014, 10:40 PM
    Thanks Gareth but it doesn't work either!
  • Mon, May 19, 2014, 10:42 PM
    The error message is 'Invalid course format'
  • Gareth J Barnard
    Mon, May 19, 2014, 10:48 PM
    Hi n kearns,

    Ok, I have not used that functionality before. So try 'topcoll' please.


  • Mon, May 19, 2014, 10:55 PM
    I sussed it! Thanks Gareth, quite new to all this - just 'topcoll' did it
  • Tue, May 20, 2014, 10:17 PM
    Good day Gareth, is there any chance for you to point me in the right direction? :P , am not a js expert so, it´s been a little messy to understand module.js ... :S


  • Gareth J Barnard
    Wed, May 21, 2014, 1:41 AM
    Hi Chriss,

    This is the code that does the toggling: - you would need to modify the code such that it remembered what was the last toggle to be opened and then close it if it was different from the toggle clicked on.


  • Tue, May 27, 2014, 5:12 AM
    I'm testing with Moodle 2.6.3 and notice that in any of our courses which use this topic format, the new Edit menu for Activities and Resources becomes left aligned with the Activity or Resource title, rather than being right aligned as it is using any other course format.

    Using Firebug in Firefox, I traced it to this line:

    body.format-topcoll.editing .section .activity .actions
    position: relative;

    When I use Firebug to disable that line, the edit menu moves back to the right, where it should be and I don't immediately see any negative effects of doing that.
Please login to post comments