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


  • Wed, Oct 14, 2015, 12:05 AM
    We LOVE Collapsed Topics. The only thing we wish it could do is provide collapsable sections within topics (sort of like the "Flexible Sections" course format Marina created, but under the control of individual users, not set by the instructor). Any thoughts along the lines of adding this kind of expansion?
  • Gareth J Barnard
    Wed, Oct 14, 2015, 12:16 AM
    Hi Elizabeth,

    Ok, at the moment "Flexible Sections" is destructive when it comes to the structure of the course. I.e. after switching to it and then to another format, then the sections are all messed up. I believe that a course format should only ever alter the display of the course and nothing else. You should be free to switch to another course format without performing any additional work. Collapsed Topics as it stands I consider to have just about the right amount of functionality to be usable without being confusing and overbearing. Therefore the only course of action would be to create and design a new course format along the lines of Collapsed Topics and Flexible Sections such that it was coherent and completely thought out to be user friendly via a proper intuitive interface.

    Kind regards,
  • Thu, Oct 15, 2015, 12:20 AM
    Well, that makes sense. I hadn't realized "Flexible Sections" was so destructive. I agree with you that a course format shouldn't change course content.

    I wish there was a good, supported way to have collapsible sub-sections within a course, perhaps by using indentation levels of content.... (And I wish I were a better Moodle programmer, while I'm wishing....)
  • Thu, Nov 5, 2015, 4:49 AM
    I'm looking for this feature but at one level lower. So the topics of the course will still be sorted in tabs via the one topic format but the labels within each topic are collapsible to prevent too much scrolling within the topic. Has anyone seen this feature?
  • Thu, Nov 5, 2015, 7:42 AM
    You might consider Bootstrap Elements, if you are using a bootstrap-based theme. It offers collapsible labels.
  • Gareth J Barnard
    Thu, Nov 5, 2015, 11:39 PM
    Hi Ray,

    The closest format would be 'Flexible sections' but that does not have tabs. Conceptually it would be possible to make this happen, but it would be a lot of work.


  • Wed, Nov 11, 2015, 7:42 PM

    I am happy to announce this plugin has been just featured in our Plugins traffic blog. Well done Gareth!

  • Mon, Dec 7, 2015, 5:52 PM
    Hi Gareth, congratulations for your nice plugin
    How do I change language settings? I would like to change language or alternatively hide "Open all" and "Close all"
    Many thanks for your support !!!
  • Gareth J Barnard
    Mon, Dec 7, 2015, 7:28 PM
    Hi Stefano,

    As Collapsed Topics is in the plugins database then the English language strings will appear in AMOS ( and thus anybody who signs up for an account there can go in and translate them. Then the translated strings will appear in the language packs and I assume there is some way of updating them.

    To hide 'Open all' / 'Close all', comment out this line:


  • Tue, Dec 8, 2015, 2:54 AM
    Hi... We're running Moodle 2.7.11+ (2014051211.01), and have been running the Collapsible Topics format a few months without any problems. We installed the latest version -- 2.7.4 (2014092005) for Moodle 2.7 -- on our test server, and now notice that section titles do not display in courses with using this format (new course, too). When we revert back to the previous version, the section titles come back. We are running PHP version 5.5.29. I also installed a fresh Moodle 2.7.11 version on my local machine and installed the collapsible formats topic, and notice the same problem.

    Is there something else that we need to do for the update to work properly? Or perhaps is this a problem others have seen?

    Thanks much..... Brian
  • Gareth J Barnard
    Tue, Dec 8, 2015, 2:57 AM
    Hi Brian,

    I don't know, I've raised:


  • Tue, Dec 8, 2015, 3:00 AM
    Thanks, Gareth. I forgot to mention that I also see the same problem -- sections titles don't display -- on a fresh Moodle 3.0 install, with the appropriate version of the course format installed. -- Brian
  • Gareth J Barnard
    Tue, Dec 8, 2015, 3:06 AM
    Hi Brian,

    The section titles are working for me in both the M2.7 and M3.0 versions - they are the toggle headings after all. Please post screen-shots on: with full details of the theme you are using.

    Kind regards,

  • Tue, Dec 8, 2015, 3:34 AM
    Gareth -- I think I may have discovered the problem. We have the "Toggle Background" color set to #FFFFFF (white). With it set to white (and we have all the Collapsed Topics color options set to #FFFFFF a the default), it appears as if the section title disappears. When I set "Toggle Background" to a different color, the sections titles appear (white text on the colored background). It appears that this latest version of the Collapsed Topics course format is changing the section title text color to white (the previous version doesn't do this). With white text on a white background, it looks as if the section title disappears. When we revert back to the Topics format, the actual color for section titles returns. This happens with our custom theme, and with the Clean theme.

    I hope this makes sense and is helpful. Please let me know if it would still be a good idea for me to submit this to the forum.

    Thanks... Brian
  • Gareth J Barnard
    Tue, Dec 8, 2015, 6:23 AM
    Hi Brian,

    I've scowered the code and none of the supplied defaults are white. So I don't understand why you are setting them all to white. What was the previous version of Collapsed Topics please? As these settings have been in place for ages and do control the colour of the section title and hence when you do change to Topics they go back to that of the theme setting.

    I'll have another look tomorrow and double check.

    No need for a post yet.

    Kind regards,

Please login to post comments