Blocks: Course contents

Maintained by Picture of David MudrákDavid Mudrák
Course contents block displays a list of all visible sections (such as topics or weeks) in the course. Clicking at a link scrolls to that section or displays just that particular section, depending on the course layout setting.
1078 sites
61 fans

Build status

Course contents block is a plugin for Moodle that displays a list of all visible sections (such as topics or weeks) in the course. Clicking at a link scrolls to that section or displays just that particular section, depending on the course layout setting.

If the section name is explicitly defined, it is displayed in the course contents outline. If enabled, the block can eventually extract a suitable section title from the section summary text.


In older Moodle versions, course sections could not be named explicitly. Many teachers used to put headings manually to the course summary text fields. This block did an awesome job that it automagically extracted these headings from the summary fields and generated a nice course contents from them.

This feature is still available but it is less useful in modern Moodle versions where course sections can have explicit section titles defined.

Automatic section title

If the section name is not explicitly defined and the auto title feature is enabled, the block automatically extracts a suitable title for the section from the section summary text.

If the summary starts with a heading (H1, H2, H3, etc), the heading will use such heading text. If the summary starts with a bold text, it will be used as a section title. If the summary consists of several paragraphs, the first one will be used.

Technically speaking, the plain text content of the first non-empty HTML DOM node from the section summary can be used as the summary title.

Tips and features

  • Section titles can be enumerated.
  • You can combine the auto title feature with the multi-language filter to generate course contents in the user's language.
  • The block fits nicely into multipage course layout (introduced in Moodle 2.3).


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4


Picture of David Mudrák
David Mudrák (Lead maintainer)
Picture of Dan Marsden
Dan Marsden: Contributor
Picture of Petr Skoda
Petr Skoda: Contributor
Picture of Nicolas Dunand
Nicolas Dunand: Contributor
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Just wondering . . .
    Sat, Nov 26, 2016, 4:27 PM
    David, are you thinking about an update for Moodle 3.2?
    Anyone: as David says, often version for X works with X+0.1 - has anyone tested?

  • Picture of David Mudrák
    Mon, Nov 28, 2016, 6:17 PM

    I'll try to look at updating my plugins for 3.2 this week. Any help with testing current versions will significantly help, thanks in advance!

  • Beat Schweitzer
    Wed, May 31, 2017, 9:16 PM
    Hi David,
    is this plugin continued? I used it in Moodle 3.2 without noticing any issues. After updating to Moodle 3.3 I only see the section 0 as navigation point which makes this plugin pretty useless in Moodle 3.3.
    Best regards, Beat
  • Picture of Nicolas Dunand
    Fri, Jun 2, 2017, 4:11 PM
    Hi Beat, hi David,

    Observing the same thing here. I think it only comes down to commenting out 3 lines in block_course_contents.php (the IF block containing $course->numsections), as $course->numsections is not relevant anymore due to MDL-57769.
  • Picture of Nicolas Dunand
    Fri, Jun 2, 2017, 4:17 PM
    Hi David,

    I just filed a PR on GitHub offering a fix for this.
  • Beat Schweitzer
    Fri, Jun 2, 2017, 4:35 PM
    Hi Nicolas,
    thank you for providing this fix. Now all the sections are there again.
  • Picture of David Mudrák
    Fri, Jun 2, 2017, 8:23 PM

    Good catch! Thanks Beat for reporting this, and many thanks Nicolas for fixing it promptly. I have included the fix in the version 5.1 of the block for Moodle 3.3.

  • Picture of adan martinez
    Tue, Oct 17, 2017, 2:50 AM

    Great work with this plugin,

    However i got a question to David, how can i translate to spanish all sections?, i mean stuff like navbar text, progress bar text and notes and doubts section.
    i unpacked the plugin but i can't find anything.

    Thanks in advance!!!

  • Picture of David Mudrák
    Tue, Oct 17, 2017, 2:53 AM

    Sorry Adan, I am confused. There is actually nothing to be translated really - the block just displays the section names as defined by the teacher.

  • Germán and Temudgin
    Thu, Nov 2, 2017, 11:43 AM
    Will this plugin be available for Moodle 3.4 ?
    It seems to be working well in the current beta smile
  • Picture of David Mudrák
    Sat, Nov 11, 2017, 4:33 AM

    Thanks Germán for testing. I just released a version 5.1.1 that has been tested against Moodle 3.4. There are no functionality changes from the version 5.1. Just the reported coding style violations have been fixed and travis-ci integration updated.

  • Picture of Ray Mizzi
    Thu, Nov 8, 2018, 3:39 PM
    It is not working in a course in my 3.5.
  • Picture of David Mudrák
    Fri, Nov 9, 2018, 4:09 PM

    Ray, can you please go to and describe your particular issue there? I believe it will something trivial as it works in 3.5 as expected.

  • Picture of Bryce Hepburn
    Wed, Nov 14, 2018, 3:19 PM
    Good day, unless im doing something wrong it is only displaying the course name and not the sections in the course content block. im running mooodle 3.4.2 and have installed the latest version of Course Content. Pretty sure i am doing something.
  • Picture of David Mudrák
    Wed, Nov 14, 2018, 4:04 PM

    Bryce, can you please raise it as an issue in the plugin's tracker and provide more details on how the block is configured and how the course looks like. Thanks.

1 2 3 4
Please login to post comments