Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 59 additions & 1 deletion src/plugin-slots/AdditionalCoursePluginSlot/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,64 @@
# AdditionalCoursePluginSlot
# Additional Course Plugin Slot

### Slot ID: `org.openedx.frontend.authoring.additional_course_plugin.v1`

### Slot ID Aliases
* `additional_course_plugin`

## Description

This slot is used to add a custom card on the the page & resources page.

## Example

The following `env.config.jsx` will add a custom card at the end of the page & resources section.

![Screenshot of the unit sidebar surrounded by border](./images/additional-course-plugin-slot-example.png)

```jsx
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
import { Badge, Card } from '@openedx/paragon';
import { Settings } from '@openedx/paragon/icons';

const config = {
pluginSlots: {
'org.openedx.frontend.authoring.additional_course_plugin.v1': {
plugins: [
{
op: PLUGIN_OPERATIONS.Hide,
widgetId: 'default_contents',
},
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'custom_additional_course',
type: DIRECT_PLUGIN,
RenderWidget: () => (
<Card className={'shadow justify-content-between'} >
<Card.Header
title={'Additional Course'}
subtitle={(
<Badge variant="success" className="mt-1">
slot props course
</Badge>
)}
actions={<Settings />}
size="sm"
/>
<Card.Body>
<Card.Section>
Additional course from slot props description.
Or anything else.
</Card.Section>
</Card.Body>
</Card>
),
},
},
]
}
},
}

export default config;
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.