Files
frontend-app-learning/src/plugin-slots/SequenceContainerSlot
Brian Smith e656f5445c feat!: organize plugin slots as components, add footer slot (#1381)
BREAKING CHANGE: slot ids have been changed for consistency
* `sequence_container_plugin` -> `sequence_container_slot`
* `unit_title_plugin` -> `unit_title_slot`
2024-05-17 12:09:47 -03:00
..

Sequence Container Slot

Slot ID: sequence_container_slot

Props:

  • courseId
  • unitId

Description

This slot is used for adding content after the Sequence content section.

Example

The following env.config.jsx will render the course_id and unit_id of the course as <p> elements in a <div>.

Screenshot of Content added after the Sequence Container

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

const config = {
  pluginSlots: {
    sequence_container_slot: {
      plugins: [
        {
          // Insert custom content after sequence content
          op: PLUGIN_OPERATIONS.Insert,
          widget: {
            id: 'custom_sequence_container_content',
            type: DIRECT_PLUGIN,
            RenderWidget: ({courseId, unitId}) => (
              <div>
                <p>📚: {courseId}</p>
                <p>📙: {unitId}</p>
              </div>
            ),
          },
        },
      ]
    }
  },
}

export default config;