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, Sep 17, 2014, 4:00 PM
  • Sat, Sep 20, 2014, 5:24 AM
    Hi Gareth, I've noticed some new errors in our apache logs being generated by collapsed topics. This has only started happening since we've upgraded to Moodle 2.5,7, version 2013110504 / of the topcoll plugin. We were on 2013110503 / before and did not get the errors. I can get them to reliably be generated when I click to expand or collapse a section, or expand/collapse all sections. Happens in multiple courses, and no matter whether I use Google Chrome or IE 11.

    It's worth noting the student does not see any errors, it looks to be working fine. The only notice of the error shows up in the apache logs.

    A sample of the messages is below:
    [Fri Sep 19 17:14:04 2014] [error] [client #] topcoll_toggle_889 is before: topcoll after: ::::, referer:
    [Fri Sep 19 17:14:04 2014] [error] [client #] topcoll_toggle_889 is before: topcoll after: yyyy, referer:
    [Fri Sep 19 17:14:05 2014] [error] [client #] topcoll_toggle_889 is before: topcoll after: yyyy, referer:
    [Fri Sep 19 17:14:21 2014] [error] [client #] topcoll_toggle_889 is before: topcoll after: ::::, referer:
    [Fri Sep 19 17:14:26 2014] [error] [client #] topcoll_toggle_889 is before: topcoll after: yyyy, referer:
    [Fri Sep 19 17:14:32 2014] [error] [client #] topcoll_toggle_889 is before: topcoll after: Yyyy, referer:
    [Fri Sep 19 17:14:59 2014] [error] [client #] topcoll_toggle_889 is before: topcoll after: yyyy, referer:
    [Fri Sep 19 17:15:08 2014] [error] [client #] topcoll_toggle_889 is before: topcoll after: ::::, referer:
  • Gareth J Barnard
    Sat, Sep 20, 2014, 5:56 PM
    Thanks for the report Mathew,

    It appears to be debugging code left over from development that I forgot to remove. I'm kicking myself over that. Please delete line 48 of settopcollpref.php being: error_log($name.' is before: '.$USER->ajax_updatable_user_prefs[$name].' after: '.$value);

    I will put out an update soon.


  • Wed, Nov 12, 2014, 10:40 PM
    Hey Gareth

    do you think there might be a chance that this plugin could become a core feature? I like it very much and according to the stats (114264 downloads) I am not the only one.

  • Gareth J Barnard
    Wed, Nov 12, 2014, 10:43 PM
    Hi Ioana,

    Thank you for your kind words.

    To be honest if it was to be a core feature it would have been by now. Pragmatically if it was I would lose control of it. I support it all the time and wonder what benefit putting it into core would bring.


  • Wed, Nov 26, 2014, 6:43 PM
    Hi Gareth,

    I have installed Moodle 2.7.2, aldo I have installed the Collapsed Topic.

    However when I try to custom the settings of the topics nothing happens. For example,: Toggle text element align to left is not working.

    The same for all the settings of the topic.

    Please, let me know what is wrong?

  • Gareth J Barnard
    Wed, Nov 26, 2014, 8:43 PM
    Hi Jose,

    To be honest I don't know what is wrong because the code works for me.

    Ok, please could you make a post on the 'Courses and course formats forum' - - with the following details:

    Collapsed Topics version.
    Screen shot of the issue.
    Screen shot of the browser console showing any errors.
    Details of any other third party plugins installed.
    Theme used.
    Details of any customisations made to the code.
    Details of how you installed the format and what bits of the file you used.


  • Fri, Mar 13, 2015, 3:16 AM
    Hi Gareth,

    Very good plugin, but I have a problem, does not work with the official apps of moodle. There is a chance to resolve this problem?.

    Juan Pablo
  • Gareth J Barnard
    Fri, Mar 13, 2015, 3:29 AM
    Hi Juan,

    What official apps please? In what way does it not work? Please post screen shots on the 'Courses and course formats' forum.

    There is only a chance of a solution if I can replicate the issue, determine what is going on and then work out a solution.

  • Fri, Mar 13, 2015, 4:15 AM

    Sorry, try again in the smartphone and now it works, maybe it was the cache.
    Thank you for your immediate response.

    Juan Pablo
  • Thu, Jul 2, 2015, 1:28 AM

    First of all, nice plugin. This is one of the best course formats by far.

    I'm having problems restoring courses with this format in Moodle 2.9. I'm using topcoll (released today)

    This is the error I get when I try to restore a course:

    mod_fcgid: stderr: PHP Fatal error: Cannot use object of type stdClass as array in [moodle directory]/course/format/topcoll/lib.php on line 939, referer: http://[moodle url]/backup/restore.php

    If I use another format, I get no errors.
  • Gareth J Barnard
    Thu, Jul 2, 2015, 1:31 AM
    Thanks for the report Emilo, I'll look into it.
  • Thu, Jul 2, 2015, 4:42 PM
    Thank you Gareth, it's fixed now smile
  • Mon, Sep 28, 2015, 8:50 PM
    Hi Gareth,

    I've been testing this plugin on Moodle 2.9.2 on PostgreSQL and works great, but it doesn't apply the Toggle foreground and Toggle foreground hover colour settings to the course (not the default ones nor the ones overridden in the course), the text shows up always black.

    The Toggle background and Toggle background hover colour settings work fine, so I don't know if there is something wrong with the other two or I'm missing something...
  • Gareth J Barnard
    Tue, Sep 29, 2015, 6:32 PM
    Hi Inigo,

    This is almost certainly a CSS conflict with another plugin / theme. Could you post details of all versions of things on the 'courses and course formats' forum and if possible a guest login to a course with the issue.


Please login to post comments