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:
6006 sites
148 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


  • Gareth J Barnard
    Wed, Dec 5, 2012, 6:32 PM
    Dear Marina,

    Thank you smile.

    You raise a good point with db/upgrade.php and I'll look into it. I did initially attempt to instantiate an instance of my format_topcoll class but could not because the base constructor is protected. I could create a public constructor in my class and work that way, but probably a fudge solution. As the user has changed the format to that of a different one and the code copes when it changes back (admittedly to defaults) then a check on the format would be prudent.

    With 'restore_topcoll_setting()' I'm using the assembly language paradigm of push and pop with registers before a call such that I can reuse your updating code and refresh the cache when I need to reset all courses with my format not just the calling one. The same goes with 'reset_topcoll_setting()'. This temporarily changes the courseid in the base class such that the updating methods write to the courseid of the course I want to update.

    Thank you for input smile,

  • Tue, Jan 1, 2013, 12:17 AM
    Hi Gareth,
    We just upgraded from 2.2 to 2.4. We use the week format and in the old version both the date and title were visible. In the new version it seems it is either but not both. Is there a way to show both teh date and title in the section header?
  • Gareth J Barnard
    Thu, Jan 3, 2013, 8:27 AM
    Dear All,

    I have just fixed this, please download an updated version from


  • My son
    Thu, Jan 3, 2013, 3:26 PM
    Hi Gareth,

    I think I've found a bug. After upgrading to 2.4, I noticed that on some courses the sidebars were missing. First, I thought this was a Moodle problem. However, after some investigation, I noticed that this only occurs if the course format is Collapsed Topics and the number of sections is set to 0.

    Could you please have a look at this?

  • Gareth J Barnard
    Fri, Jan 4, 2013, 5:44 AM
    Dear Aylwin,

    I have PM'd you with a link to a fixed version to test.


  • Garry Edmonds
    Mon, Jan 7, 2013, 12:03 PM

    We have been using this tool since upgrading to Moodle 2.3 in October, 2012 and it has become very popular with many of our staff. We are having an issue when users set “Screen reader” to “Yes” in their Moodle profile. The course displays in an odd way with topic 5 displaying by itself in the right hand area and the rest of the formatting displaying incorrectly. We don’t get this problem with the other formats.
    Is this likely to be a problem with our theme or with the plugin? It’s surprising how many people that don’t use screen readers have set this setting to yes.

  • Gareth J Barnard
    Tue, Jan 8, 2013, 3:55 AM
    Dear Garry,

    Thanks for letting me know. It was a slight coding issue. Please could you test:

    And see if it is fixed for you.

    It is interesting to note that Moodle 2.4 has removed that setting.


  • Garry Edmonds
    Wed, Jan 9, 2013, 1:00 PM
    Hi Gareth,

    Thanks for the prompt response. I'm not able to test it so I have forwarded it on to technical staff here. I'll post the results as soon as I can.

  • Thu, Jan 10, 2013, 3:33 AM
    Re: the problem with Screenreader set to YES breaking the page layout: I installed v2.4.9.5 on our test installation at Moodle 2.3.3 (Build: 20121112).

    Good: Blocks now appear where they belong (rather than at the bottom of the page).

    Not Good: Section names do not show. This problem occurs whether using default name or a custom name, and happens in all themes.
  • Gareth J Barnard
    Thu, Jan 10, 2013, 4:25 AM
    Dear Michele and Garry,

    Section name now fixed, please test:


  • Thu, Jan 10, 2013, 5:51 AM
    Hi Gareth, thanks for the super-quick attention to this.

    With screenreader is enabled in My profile,I can now see Section names.

    There is no toggle-all section, and no toggles in section headers. It looks like the Topics format. Can I assume this is on purpose, as someone using a screen reader will not find any value in having to toggle sections open? I don't have an older version available any longer to compare (from before you rebuilt Collapsed Topics for 2.3). Is this what it used to do?

  • Gareth J Barnard
    Thu, Jan 10, 2013, 6:16 AM
    Dear Michelle,

    It is the intent that it looks like the topics format such that I envisage that screen reader software needs to 'speak' out the contents of the page using the headings and I'm not sure how a toggle functionality would work. I have asked for those with screen reader software to test in the past and have attempted to find free screen reader software to test myself but to no avail. If anybody can test and provide feedback that would be appreciated.

    I'm annoyed with the small fix, but just goes to prove that you should not code at the end of a twelve hour day.


  • Thu, Jan 10, 2013, 6:34 AM
    Gareth, While I've got your attention, I just posted an improvement suggestion and shared a screenshot and a .zip of our modifications to top_coll on moodletracker (

    To summarize, we made two basic changes:

    - The toggle arrows conform to the standard of Right arrow = closed/collapsed and Down arrow=open. This is how the fly out menus in the Moodle Navigation work, and is a common convention. (Our users found the up and down arrows confusing.)

    - When editing is on, the link to the collapsed topics settings page is just a regular-sized text link with a small wrench icon (instead of the very large orange toolbox). We located the Collapsed topics settings link inside the "toggle-all" element (for proximity).


  • Gareth J Barnard
    Thu, Jan 10, 2013, 6:46 AM
    Dear Michelle,

    I've just replied on the tracker smile - I get eMail notifications in both instances smile


  • Fri, Jan 18, 2013, 9:36 AM
    Hi Gareth,

    taking over the reigns from Garry Edmonds' comments,

    Screen Reader set to 'yes' in 2.3 bug. Thanks for bug fixes thus far.

    Implications on my install (Moodle 2.3.1, TopColl with own config and styles) is that now the core functionality with Screen Reader set to 'No' doesn't work sad
    clicking any section title or global open/close has no result


Please login to post comments