Catalogue

From MoodleDocs
workplacelogo.png This feature is part of Moodle Workplace™, which is available through Moodle Certified Partners and Service Providers only.

Learning Catalogue Overview

The learning catalogue contains all courses available in your Moodle Workplace tenant. Once enabled, it can be accessed via the top-level Catalogue menu item or directly via https://<site>/course.

The catalogue comprises two different pages:

  1. Main page This is the main view when navigating to the catalogue. It shows all courses available to the current user.
  2. Results page The results are shown once a category has been selected or a search has been executed. The filter sidebar, if configured, displayed on the left, lets you narrow down the course search.


Moodle Workplace Learning Catalogue

Learning catalogue main page

The following is an annotated view of the learning catalogue’s main page:

Learning Catalogue - Main Page.png
  • The category selector lets you choose a single category or sub-category. Once selected, the results page will be displayed. The number of category levels shown can be specified in the learning catalogue settings.
  • The catalogue search lets you narrow down the search using Moodle’s standard search operators. Once executed, the results page will be displayed.
  • The course cards show details about each course. The attributes displayed, depend on the learning catalogue settings.

If the number of courses exceeds the number specified in the learning catalogue settings, the page navigation is shown at the bottom of the catalogue.

Learning Catalogue - Navigation.png

Learning catalogue results page

The results page is shown if one of the following two actions has been carried out:

  • A search has been executed using the catalogue search
  • A category or sub-category has been selected

The following is an annotated view of the learning catalogue’s results page:

Learning Catalogue - Results Page.png
  • The category selector lets you choose a single category or sub-category. Once selected, the results page will be refreshed.
  • The catalogue search lets you narrow down the search using Moodle’s standard search operators. Once executed, the results page will be displayed.
  • The course cards show details about each course. The attributes shown, depend on the learning catalogue settings.
  • The filter lets you narrow down the shown results further. There are up to three types of filters that will be displayed:
    • Subcategory filter: If the shown courses are spread across multiple courses or the selected category contains sub-categories, these will be available for selection. If more than 5 subcategories are available, a Show more link lets users display all categories.
    • Tags filter: If any of the shown results contain any course tags, these will be available for selection. If more than 5 tags are available, a Show more link lets users display all tags.
    • User-defined course fields filter: If any of the shown results contain any course user-defined course fields, these will be available for selection. If more than 5 fields are available, a Show more link lets users display all course fields. In the screenshot above, the Level attribute is a user-defined course field.

The filters available to users and the order in which they are arranged can be specified in filter section of the catalogue configuration.

Course cards

Course cards show details about each course. While course cards on the main page look slightly different from course cards on the results page, they can both show the same fields. The attributes displayed, depend on the catalogue configuration and can differ for each course card type.

The screenshot below shows an annotated course card from the main page.

Learning Catalogue - Course card I.png


The same course card on the results page looks as follows:

Learning Catalogue - Course card II.png


The following fields are available on course cards:

Field Source and description
Course image Course settings → Course image
Course title Course settings → Course full name
Course description Course settings → Course summary

The max. length can be specified via the Truncate course summary setting in the Learning catalogue settings.

Course tags Course settings → Tags
Course contact All course users listed in as Course contacts (Appearance > Courses), by default the Trainer role.
Course category Course settings → Course category
Course start date Course settings → Course start date
Course end date Course settings → Course end date

If the setting is disabled, the field will be hidden.

Course custom fields Course settings → <fields>

These fields must be specified in Learning > Default settings > Course custom fields. All available field types are supported.

You can also use this feature to implement a link to all Programs the course belongs (like in the example above)

Price Course settings → Price

If a custom course field has the short name price (specified in Learning > Default settings > Course custom fields), special built-in CSS is applied that displays its content accordingly.

The field can be of any type; as long as the short name is price, Moodle Workplace will apply special formatting.

The configuration of these fields, for instance in which order they will appear, takes place in the Catalogue settings.

Enabling / Disabling the Learning Catalogue

The learning catalogue is disabled by default. To change this setting, navigate to Learning > Learning catalogue settings and tick the Enable learning catalogue option.

Learning Catalogue - Enable.png


Alternatively, you can permanently enable the learning catalogue by adding the following setting to your config.php:

$CFG->tool_catalogue = true;

Once the catalogue has been enabled, all catalogue settings will be shown.

Catalogue Settings

To configure the learning catalogue, either navigate to Learning > Default settings > Learning catalogue settings or select the catalogue icon from the Workplace Launcher.

Here, you will find the following sections:

  1. Learning catalogue settings: Generic settings impacting the entire catalogue
  2. Fields to display in the 'tiles' (compact) view of learning catalogue: Fields shown on the main page
  3. Fields to display in the 'list' (detailed) view of learning catalogue: Fields shown on the results page
  4. Fields to display in the learning catalogue filter: Fields shown in the filter pane

The four areas are described in detail in the following subsections:

Learning catalogue settings

The following options are available in the learning catalogue settings:

Learning catalogue settings I.png
  • Enable learning catalogue: see dedicated section above
  • Number of courses per page, site home page: Maximum number of courses shown on the public learning catalogue. If the number exceeds the number of courses to be shown, the page navigator will be made available.
  • Number of courses per page, main catalogue page: Maximum number of courses shown on the main page. If the number exceeds the number of courses to be shown, the page navigator will be made available.
  • Number of courses per page, search results: Maximum number of courses shown on the results page. If the number exceeds the number of courses to be shown, the page navigator will be made available.
  • Maximum number of same-level categories: Specifies the maximum number of same-level categories shown in the category selector. Categories will be displayed in the same order as they have been defined in the course management page. Categories exceeding this maximum number will be hidden, but courses will appear in the search results.
  • Maximum number of nested category levels: Specifies the maximum number of nested category levels in the category selector. Categories below this level will be hidden, but courses will appear in the search results.
  • Safe HTML tags in summary and text fields: List of the HTML tags that will be kept when displaying text fields (course summary and course custom fields). This might conflict with “Truncate course summary”.
  • Truncate course summary: Number of characters shown in the course summary. This might conflict with “Safe HTML tags in summary and text fields”. Set 0 for no truncation.
  • Course search method: The Simple Search option is very similar to the existing course search method in Moodle LMS. It simply searches for course fullname, course shortname and course summary, giving priority to fullname and shortname. Extended search can be customised to search in course custom fields, categories, tags and trainers.
Simple Search Extended Search
Case-sensitivity no yes
Support for wildcards (% and _) yes yes
Requires cron process no yes
Uses index no (on-the-fly search) yes (must be built before first use)
Supports field selection no yes
Supports field prioritisation no yes

Note: when you switch from Simple search to Extended search, you need to save changes before the Fields to search for keywords section will be shown.

The new search API allows connecting more search methods using hooks and may be potentially configured to use external search engines such as Solr or Typesense.

Fields to display in the 'tiles' (compact) view of the learning catalogue

In this section, you can configure which fields are shown in cards on the catalogue’s main page. There are two types of fields you can select:

  1. Built-in course fields: Standard course fields, namely Course summary, Course category, Tags, Start date, and End date.
  2. Course custom fields: Fields which have been added via Learning > Default settings > Course custom fields (all custom type fields are supported). If the visibility of a field is set to Trainers or Nobody, the field can still be shown in the learning catalogue. However, a warning icon is displayed in the configuration, indicating that “This field has restricted visibility on the course information and enrolment pages, however it can still be made available in the learning catalogue. If enabled here, the field will be visible to everybody.”

In the Display field name column, you can specify whether the field label is shown or hidden. By default, the Name of the field is displayed, which you can override via the Edit action.

Any fields of type Text area, whether built-in or custom, have an additional setting Allow HTML tags with the options Only safe HTML tags (default), Allow any HTML tags (no filtering), and Strip all HTML tags (full filtering).

The order of the fields shown in the compact view can be arranged via the up and down arrows in the Order column.

Learning catalogue settings II.png


In the sample configuration shown, seven fields have been configured; they are explained in the table below, alongside a resulting sample tile:

Name Field type Note
Price Custom

(Numeric)

See how Payment options are supported
Learning Catalogue - Tiles view - Example.png
Course summary Custom The text will be truncated

.--> see Truncate course summary setting

Tags Built-in Displayed as course tags
Start date Built-in Date is shown in the locale of the user
End date Built-in Will be hidden, if the field is not set
Estimated learning time Custom

(Numeric)

  • The label has been modified to "Time required".
  • The specified Display template (here {value} hours), is applied
  • A warning is shown in the configuration because the visibility of the custom field is not set to Everyone
Level Custom

(Dropdown)

Dropdown values are shown as text

Fields to display in the 'list' (detailed) view of the learning catalogue

In this section, you can configure which fields are shown in cards on the catalogue’s results page. The fields available for selection and the rules and restrictions that apply are the same as for the configuration of the compact view.

Applying the same values as in the previous example will result in the following detailed list view tile:

Learning Catalogue - List view - Example.png

The positioning of the price, alongside other elements, can be changed via CSS settings. See Styling the Learning Catalogue via CSS section for details.

Fields to display in the learning catalogue filter

You can select any available field that should be displayed as filters in the catalogue and arrange them in the appropriate order.

The following fields are available:

  1. Subcategories: If the selected category contains subcategories, these will be shown in the filter pane. They are sorted by popularity in descending order. Popularity is calculated as the number of courses found in the search in this category.
  2. Tags: If course tags have been configured, these will be shown in the filter pane.
  3. Custom fields: Any course custom fields of type Drop-down, Checkbox, and Number will appear in the filter pane.

If the number of elements exceeds 5, a Show more link is shown. When selected, all additional tags are displayed. If the Show less status is active and there are tags selected in the list hidden from view, a badge will indicate how many more filter items have been ticked.

Learning catalogue settings III.png

In the example above, the following filter fields have been configured:

  • Tags: More than 5 tags are available, hence a Show more link lets users display all tags.
  • Level: Drop-down custom course field with configured menu options Beginner, Intermediate, Advanced.
  • Monthly selection: Checkbox that is currently collapsed in the filter.
  • Estimated learning time: Numeric field where the label has been renamed to Required time. The available time ranges have been specified via the Action cog wheel (details see below). The warning is shown because the visibility of the custom field is set to Trainers or Nobody, instead of Everyone.
  • Price: Another numeric field. The available filter options have been specified via the Action cog wheel (details see below).
  • Subcategory: This field has been hidden from the catalogue filter.

Filter ranges

For numeric custom fields, filter ranges can be configured manually via the Action cog wheel.

In the Edit filter ranges modal window, you can specify as many ranges as you wish. Initially, 4 ranges are shown; more can be added via the Add range button at the bottom. Each range has the following settings:

  • Range name: The label shown in the filter sidebar. If left empty, the range name will be created automatically from the range bounds, according to the following rules:
    • If a minimum and maximum value has been set, they will be used as range bounds, concatenated by a hyphen, e.g. 10 hours - 20 hours.
    • If lower and upper bounds are the same, the range name the value of the number (formatted using the display template specified), e.g. 20 hours.
    • If the minimum value is left empty, "Under <maximum value>" will be shown, e.g. Under 20 hours.
    • If the maximum value is left empty, "Over <maximum value>" will be shown, e.g. Over 20 hours.
    • If neither minimum nor maximum values are specified but Include empty values is checked, the default range name is set to Not specified
  • Minimum value: Specify the lowest value of this range or leave empty if there is no limit. A value of 0 will be displayed according to the Display when zero setting in the specification of the numeric custom field. This can either be the number 0 itself, some text (e.g. Free) or an empty string.
  • Maximum value: Specify the highest value of this range or leave empty if there is no limit.
  • Include empty values: Select if empty values should be included in the range.
  • Delete range: Range is removed from the list of ranges. You cannot re-arrange the order of the ranges.
Learning Catalogue - Filter ranges.png

Moodle Workplace only checks ranges against the following criteria:

  • There is at least one range
  • Each range has either a minimum or a maximum value set, or the Include empty values checkbox ticked
  • If both minimum and maximum are specified, they should not conflict, for example Minimum value >= 10 AND Maximum value <= 10 is possible, but Minimum value > 10 AND Maximum value < 10 is not.

Any further range inconsistencies (ranges do intersect, gaps between ranges, or the order of ranges) are not validated, so ensure that the configuration is as intended.

In order to add an option to the learning catalogue filter that shows the specified value Display when zero (e.g. Free), you need to configure one range as follows:

Learning Catalogue - Filter ranges zero.png
  • Range name: Empty
  • Minimum value: Greater than or equal 0
  • Maximum value: Less than or equal 0
  • Include empty values: On or Off


Fields to search for keywords

When the Course search method has been set to Extended search, you can specify which course fields (both, built-in and custom) should be included in the search (via the Display toggles) and arrange them in the Order of priority. After changing the configuration, the search index has to be rebuilt, which takes place in the background (via cron) and might take some time to show the expected results.

Learning catalogue settings IV.png

Feature course highlighting

Courses can be highlighted, which is indicated via a customisable badge in the course image. Featured courses are listed first on the course catalogue main page (but not on the results page).

Learning Catalogue - Featured learning I.png


To highlight courses, you will need to go through the following steps:

  1. Add a course custom field of type Checkbox (see above)
  2. Select the custom field from the Featured custom field dropdown Learning catalogue settings.
  3. Go to each course that has to be highlighted and tick the Checkbox in the course settings
Learning Catalogue - Featured learning II.png


To display a dedicated section at the top of the catalogue, tick the Show featured section in catalogue option. The Featured section title lets you specify the heading of the featured section ("Featured" if left empty). You can provide optional instructions via the Featured section description setting.

Learning Catalogue - Featured learning III.png


When the featured section is activated, featured courses will still be shown in the All available courses section underneath, but the courses won't be shown at the top of the list.

Setting the catalogue as the default site home

The site home can be specified via the Start page for users setting in Appearance > Navigation.

Learning Catalogue - Site home.png


In addition to the standard LMS settings Home, Dashboard, My courses, and User preference, in Moodle Workplace Catalogue has been added as an option. Once this is selected, the learning catalogue will be the first page users will be redirected after logging in to the site.

Course visibility in the catalogue

Visibility of courses in the catalogue is controlled by the capability moodle/category:viewcourselist, which can be added to roles and assigned at the course category level.

By default, when Moodle Workplace is installed, this capability is not allowed for the "Guest" and "Authenticated user" roles but is allowed for the "Tenant user" role (which is automatically assigned to each user in the course category of their tenants). This means that, by default, guests cannot browse the catalogue at all, while tenant users can browse all categories within their tenant category.

Please note that if your Workplace site has been upgraded from Moodle LMS without setting $CFG->forcewpsetup, your defaults will be different. See the Upgrade form Moodle LMS section in the Installation guide for more details.

Important: When you test the setup, ensure that you are not an administrator or manager. Additionally, make sure you are not enrolled in any courses that you are trying to hide from the catalogue. Some changes (e.g., changes in roles) may not be immediately visible in the current user session since the catalogue's session cache has a 10-minute lifetime. To reset the catalogue cache, simply log out and log back in again.

Hiding program courses in the catalogue

If you want to completely hide program courses in the Catalogue, but have them available for users who are allocated to the program, follow the following steps:

  1. Create a course category for courses that will not be displayed in the catalogue to learners (here, Hidden courses)
  2. Add courses to the category that must not appear in the Catalogue
  3. Go to the hidden course category permissions via the cog wheel
  4. Prohibit the moodle/category:viewcourselist capability for "tenant user" in the course category
    Learning Catalogue - Hide courses I.png
  5. Create a program in the tenant and add courses from the hidden category
  6. Allocate users to the program


Once the above configuration is completed, the behaviour will be as follows:

  • The hidden category will not appear in the Catalogue for any users (except admins)
  • Courses in the hidden category will only appear in the Catalogue for users who have been assigned to the program, but not to any other users
  • The "hidden program" and courses inside it will appear in My courses for users who have been assigned to the program, but not to any other users

Making the Learning Catalogue Public

By default, the learning catalogue is only available to logged in users. To make the catalogue public, that is, to make it accessible to users not logged in to your Moodle Workplace site, configure the following settings:

  1. Show courses on the Frontpage Go to General > Site home > Site home page and add "List of courses" to the Site home setting ($CFG->frontpage).
  2. Disable Force Login Ensure that the Force users to log in setting in General > Security > Site security settings is disabled ($CFG->forcelogin).
  3. Allow viewing of course categories and courses Go to Users > Permissions > Define roles. Select the Guest role and enable the capability to browse the list of courses (moodle/category:viewcourselist). Repeat the same step for the Authenticated user role.

Once these steps have been completed, your learning catalogue will be available online. However, to view course details or enrol on a course, users have to be logged in to your site. Therefore:

  4. Optional, but highly recommended: Set Auto-login guests ($CFG->autologinguests) in the Users > Permissions > User policies.

Payment Support

The learning catalog can automatically extract prices from course enrollment methods, display them next to the courses, and allow filtering by price. It supports the standard enrollment plugins "Self enrolment," "Enrolment on payment," and "PayPal." Community payment enrollment plugins may also work, but they need to be tested first.

To configure a course to allow enrolment once payment has been completed, follow the following steps:

  1. Ensure the Enrolment on payment plugin has been installed and configured properly.
  2. Go to Learning > Default settings > Course custom fields, select Add a new custom field, and choose of type Number.
  3. Provide Name (e.g. Price) and Short name
  4. In the Number field settings section, choose Price from enrolments plugins option from the Field types dropdown. The following three options are shown:
    • In the Currency field, enter a 3-letter currency code (https://en.wikipedia.org/wiki/ISO_4217#Active_codes). Ensure this code matches the currency code used in the available enrolment methods for the course.
    • Select the Enrolment plugins that allow students to enrol themselves in a course. If a matching instance exists with the specified currency, the price will be automatically extracted. Instances without a currency (e.g., 'Self enrolment') will be assumed to have price 0. If multiple instances of methods that allow students enrol themselves into a course exist, the lowest price will be shown. Note: Test third-party enrolment plugins thoroughly before enabling them, as they may store data differently, affecting price extraction.
    • In the Display when zero you can specify how the price is displayed when there is a self-enrolment plugin available without a payment. If left empty, the price field will not be displayed for free courses.
      Learning Catalogue - Course custom field price.png
  5. The new price field will now be available in the various fields sections on the Learning catalogue settings page (see above). Once selected, the price field will appear in the different areas of the learning catalogue.

Styling the Learning Catalogue via CSS

The learning catalogue has been designed in line with the remainder of Moodle Workplace's look & feel. If you wish to modify its layout or styling, the following CSS snippets (added as Custom CSS to the tenant or your main theme) might come in helpful.

Adding a symbol to course highlight

// Add star to course highlight field
.tool_catalogue_course_field.customfield.customfield_checkbox {
    &::before {
        font-family: 'Font Awesome 6 Free';
        content: "\f005";
    }
}
Learning Catalogue - CSS I.png

Position course fields and values in the same line

// Display course fields inline with their values
.tool_catalogue_course_field > div {
    display: inline-block !important;
}
Learning Catalogue - CSS II.png

Moving the price label

// Move price label from top right corner in line with other course properties
.tool_catalogue_list .tool_catalogue_course .tool_catalogue_course_field[data-fieldname="customfield_price"] {
    position: relative;
    width: auto;
}
Learning Catalogue - CSS III.png

Adding icons to Labels

// Display 'Folder' icon prior to 'Category' field
.tool_catalogue_course .tool_catalogue_course_field[data-fieldname="category"]::before {
        font-family: 'Font Awesome 6 Free';
        content: "\f07b";
}

// Display 'Clock' icon prior to custom 'Estimated learning time' field
.tool_catalogue_course .tool_catalogue_course_field[data-fieldname="customfield_learning_time"]::before {
        font-family: 'Font Awesome 6 Free';
        content: "\f017";
}

// Display 'Open folder' icon prior to custom 'Level' field
.tool_catalogue_course .tool_catalogue_course_field[data-fieldname="customfield_level"]::before {
        font-family: 'Font Awesome 6 Free';
        content: "\f07c";
}

// Display 'Calendar' icon prior to 'Start date' field
.tool_catalogue_course .tool_catalogue_course_field[data-fieldname="startdate"]::before {
        font-family: 'Font Awesome 6 Free';
        content: "\f073";
}
Learning Catalogue - CSS IV.png

Displaying checkbox fields as badges

// The following CSS displays a custom course field 'recommended' of type Checkbox
// Note that this can be done in addition to the Feature Highlight option

.tool_catalogue_tiles,
.tool_catalogue_list {
    .tool_catalogue_course .tool_catalogue_course_field[data-fieldname="customfield_recommended"] {
        @extend .badge;
        @include badge-variant($primary);
    }
}
 
// Show badge in tiles view (and make background red)
.tool_catalogue_tiles .tool_catalogue_course {
    .tool_catalogue_course_field[data-fieldname="customfield_recommended"] {
        position: absolute;
        left: 10px;
        top: 10px;
        max-width: 50%;
        background-color: red;
        @at-root .tool_catalogue_course {
            position: relative;
        }
    }
}

// Show badge in list view (and make background red)
.tool_catalogue_list .tool_catalogue_course {
    .tool_catalogue_course_field[data-fieldname="customfield_recommended"] {
        position: absolute;
        left: 10px;
        top: 20px;
        max-width: 20%;
        background-color: red;
        @at-root .tool_catalogue_course {
            position: relative;
        }
    }
    @include media-breakpoint-down(sm) {
        .tool_catalogue_course_field[data-fieldname="customfield_recommended"] {
            max-width: 50%;
        }
    }
}
Learning Catalogue - CSS V.png

The Learning Catalogue and Multi-tenancy

The learning catalogue shows all courses available to the current user and fully respects multi-tenancy permissions granted throughout Moodle Workplace.

Additionally, courses that have been allocated to the user via programs or certifications in the shared space, will appear in the learning catalogue.

Permissions

The following capabilities are relevant to control the management and usage of the learning catalogue:

  • Configure learning catalogue (tool/catalogue:config)