Your Moodle version

Course formats: Collapsed Topics

Maintained by Gareth J Barnard Gareth J Barnard
An interchangeable topic or week based format that solves the issue of the 'Scroll of Death' when a course has many topics.

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+.

REPORTING ISSUES: 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 'readme' file and upload and describe in detail the issue you are having on the 'Course formats' forum.

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:


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

Show comments
  • Picture of Juan Pablo L
    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.

  • Picture of Juan Pablo L
    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
  • Picture of Emilio Lozano
    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.
  • Picture of Emilio Lozano
    Thu, Jul 2, 2015, 4:42 PM
    Thank you Gareth, it's fixed now smile
  • Picture of Iñigo Zendegi Urzelai
    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.


  • Picture of Elizabeth Dalton
    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,
  • Picture of Elizabeth Dalton
    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....)
  • Picture of Ray O'Brien
    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?
  • Picture of Elizabeth Dalton
    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.


  • Picture of David Mudrák
    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!

1 2 3 4 5 6 7 8 9 10 11 12 13
Please login to post comments