Filtered course list

Blocks ::: block_filtered_course_list
Maintained by Charles Fulton, Kevin Wiliarty, Andrew Zito
The Filtered Course List block displays a configurable list of courses. It is intended as a replacement for the My Courses block, although both may be used. It is maintained by the Collaborative Liberal Arts Moodle Project (CLAMP).
Latest release:
704 sites
53 fans
Current versions available: 11

The Filtered Course List block displays a configurable list of courses. It is intended as a replacement for the My Courses block, although both may be used. It is maintained by the Collaborative Liberal Arts Moodle Project (CLAMP).

An administrator can apply various filters by which to organize a user's course listing in the block. Courses can be sorted by category, shortname matches or completion status. If all of the courses in a given semester have a shortname ending in a semester code, for instance, then the administrator can designate those courses to appear under "Current courses," "Future courses" or any other heading. Regex matching is supported.

Administrators can designate multiple collapsible headings and choose which of those headings, if any, should be expanded by default.

Other options include the ability to hide the block from guests or anonymous visitors, to choose whether an admin sees all courses or her own, and to hide or reveal a link to a more comprehensive course search.


Screenshot #0


Charles Fulton (Lead maintainer)
Kevin Wiliarty: Maintainer
Andrew Zito: Maintainer
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Jonathan Tulloch
    Fri, Nov 15, 2019, 4:43 PM
    Hi Kevin! The updates to this block are brilliant, and we are looking to make this a core part of student navigation advice - but I was wondering whether it is possible to change the restriction that the block only appears on the Dashboard? We can't seem to change this setting! Cheers! Jon
  • Kevin Wiliarty
    Fri, Nov 15, 2019, 9:27 PM
    Hi, Jonathan. I'm not sure what restriction you are referring to. You should be able to place instances of the block anywhere you like. Can you explain a bit more about what you are trying to do and what is not working as expected? Can you also mention which version of the block you are using and which version of Moodle? I'll be happy to help sort things out.
    Sat, Feb 22, 2020, 5:40 AM

    Hi Kevin. Could you have a filtering by categories and completion status at the same time? Cheers!
  • Brandon Jimenez
    Sat, Feb 22, 2020, 9:29 PM
    Hello Alexander, I think your best bet would be to use the API to create that functionality yourself. I haven't done it personally, but from what I've read in the documentation, it seems it could provide you with that kind of behavior.
  • Kevin Wiliarty
    Mon, Feb 24, 2020, 8:11 PM
    Hi Alexander, There's no ready-made filter that would simultaneously organize by category and completion status. Brandon is correct: Your best bet would be to write a filter of your own. This page has some instructions:
  • Andrés Molina
    Tue, Apr 7, 2020, 7:21 AM
    Hi there!
    I need your help, I don't know how to show all the courses without generating a link to the category, that is, I want the list of courses that fall within that category to appear in the block itself.
    Thank you so much!
  • Kevin Wiliarty
    Tue, Apr 7, 2020, 8:40 PM
    Hi Andrés, there are a couple reasons you might be seeing a list of category links rather than links to the courses in the categories. The most likely reason is that you are a site admin and you have the "Manager view" setting at "A manager sees all courses." A second possibility is that you have the "Manager view" at "A manager sees own courses" but you are not enrolled in any courses. Any user, admin or otherwise, will see that generic category list if they are not enrolled in any courses. A third possibility comes into play if your site has only one category. In that case you may want to adjust the setting "Max for single category". The default is 10, and the way that works is this: Anyone who would see the generic list will see a list of courses as long as there are only 10 or fewer. If there are more than 10 they will see a link to the category page. The idea is to prevent a situation where a manager or guest sees a list with hundreds of courses, but it's configurable, in case that is the issue. If none of these addresses your question, please offer some more details about the category structure of your site and how you would like the block to work. Cheers!
  • Andrés Molina
    Tue, Apr 7, 2020, 9:23 PM
    Hi Kevin!
    Thank you very much for answering my question, yesterday I was testing the block more thoroughly and I understand what you are saying, in effect the block only shows the courses in which the user is enrolled.
    Is there a way to show all the courses () visible to the user of the platform? (regardless of whether you are enrolled or not).
    Thank you very much and success!

    PD: The structure of the platform is as follows

    Subjects (courses)
  • Kevin Wiliarty
    Tue, Apr 7, 2020, 9:45 PM
    You might find that an enrolment-method filter does what you would like. It would allow you, for instance, to show all the courses that have guest- or self-enrollment. In practice, those would be the courses that a user would have access to, but you could use that filter on any enrolment method you prefer. The documentation for that type in particular is here: Just let me know if you have any other questions.
  • Sarah Lattimore
    Wed, Sep 1, 2021, 1:29 PM
    Hi. I was wondering whether this plugin might work to display a course list filtered by the role that the user has in the course. We have users who are enrolled in some courses as learners and other courses as teachers and their current learning block is unable to differentiate between these.
  • Vladimir Miranovic
    Thu, Oct 21, 2021, 8:45 PM
    Hi Kevin, I have one suggestion based on my needs as administrator in our moodle (used as KMS), and one question for you. First suggestion to replace already mentioned line in previous comments in "block_filtered_course_list.php" in latest 4.4.2 version - line 150 -

    $this->mycourses = enrol_get_my_courses(null, "$sortstring");


    if (is_siteadmin()){
    $this->mycourses = core_course_category::get(0)->get_courses(array('recursive' => true));
    } else {
    $this->mycourses = enrol_get_my_courses(null, "$sortstring");

    This will give the administrators that much wanted capability to filter all courses as they need, and other users will see only courses where they are enroled as that was the main purpose of the plugin. With that said, I have problem with 'generic_list' shown to users in cases where they don't have enroled courses in specified category. Can you please help me with that because I don't have time to find in the code where to turn it off, and replace with "no courses" for example.
    Thanks in advance!
  • LP _
    Fri, Mar 25, 2022, 5:05 PM
    Hi, the plugin is very useful but I can't understand one thing. If the student has no courses in which he is enrolled, the plugin shows all courses. When I enroll him in a course it works and includes the category and course in which he is enrolled. I saw it in the settings but couldn't find any controls. Thanks for the help.
  • Vladimir Miranovic
    Thu, Apr 21, 2022, 12:10 AM
    @LP _ Hi, I hope it is not too late for response. This is incredible useful plugin, and I am using multiple f_c_l blocks on custom dashboard to show different types of course categories. For me too setting - Hide "All courses" link - is not working, and I came to solution with changing couple of lines of code.
    The code in question is in "block_filtered_course_list.php" file around line 264 (last if-else if).
    Instead of:

    if (count($this->rubrics) > 0) {
    $content = new \block_filtered_course_list\output\content($this->rubrics, $this->instance->id);
    $this->content->text = $output->render($content);
    } else if ($this->fclconfig->filters != BLOCK_FILTERED_COURSE_LIST_GENERIC_CONFIG) {
    $this->liststyle = 'generic_list';
    $this->fclconfig->filters = 'generic|e';

    that is showing all courses, I put:

    // My replacment code for no courses enroled message instead of generic list.
    $usernome = fullname($USER);

    if (count($this->rubrics) > 0) {
    $content = new \block_filtered_course_list\output\content($this->rubrics, $this->instance->id);
    $this->content->text = $output->render($content);
    } else {
    $this->content = new stdClass();
    $this->content->text = '

    Sorry '.$usernome.',
    you don\'t have enroled courses in this
    type of filtered categories.

    $this->content->footer = '';
    return $this->content;

    As you can see $usernome should be defined before If-else.
    I found this personalized message is much more adequate for users without enrolment, and you can change message to better suit your system.

    Of course this is not the best practice in moodle plugin development, and this message should be actually placed in language strings file and called here, but I didn't have time, sorry.
    I hope somebody will find this useful.
  • Nathan Lind
    Tue, Jul 25, 2023, 1:30 AM
    We are so grateful for this amazing plugin! Thank you Charles, Kevin, and Andrew, for creating and maintaining it! We plan to upgrade to Moodle 4.4 in late May 2024 and will look for an updated version of this plugin for that Moodle version then. Hope that fits into your plans for upgrade timeline. Thanks again!
    Also, any inklings of Moodle making the functionality of this plugin available in core?
    Lastly, wondering if you have seen similar categorization abilities created in other plugins for the "/grade/report/overview/index.php" grades page for students, to group and sort those courses (especially useful when multiple years of courses are on one Moodle instance)?

  • Mandala Pati
    Fri, Aug 11, 2023, 6:19 PM
    Please guide me. I installed the plugin. I added plugin block to the course page. It shows list of courses which I organized previously.
    When I add filter text to Filter configuration field, nothing is changing. Why it is so?
1 2 3 4 5 6
Please login to post comments