Skip to content

Latest commit

 

History

History

NoCoursesViewSlot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

No Courses View Slot

Slot ID: no_courses_view_slot

Description

This slot is used for replacing or adding content around the NoCoursesView component. The NoCoursesViewSlot only renders if the learner has not yet enrolled in any courses.

Example

The space will show the NoCoursesView by default. This can be disabled in the configuration with the keepDefault boolean.

Screenshot of the no courses view

Setting the MFE's env.config.jsx to the following will replace the default experience with a custom call-to-action component.

Screenshot of a custom no courses view

import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

const config = {
  pluginSlots: {
    no_courses_view_slot: {
      // Hide the default NoCoursesView component
      keepDefault: false,
      plugins: [
        {
          op: PLUGIN_OPERATIONS.Insert,
          widget: {
            id: 'custom_no_courses_CTA',
            type: DIRECT_PLUGIN,
            priority: 60,
            RenderWidget: () => (
              <h3>
                Check out our catalog of courses and start learning today!
              </h3>
            ),
          },
        },
      ],
    },
  },
}

export default config;