Skip to content

Commit bad66ca

Browse files
docs: update readme for additional course plugin slot (#2315)
1 parent 2ae594f commit bad66ca

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed
Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,64 @@
1-
# AdditionalCoursePluginSlot
1+
# Additional Course Plugin Slot
22

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

55
### Slot ID Aliases
66
* `additional_course_plugin`
7+
8+
## Description
9+
10+
This slot is used to add a custom card on the the page & resources page.
11+
12+
## Example
13+
14+
The following `env.config.jsx` will add a custom card at the end of the page & resources section.
15+
16+
![Screenshot of the unit sidebar surrounded by border](./images/additional-course-plugin-slot-example.png)
17+
18+
```jsx
19+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
20+
import { Badge, Card } from '@openedx/paragon';
21+
import { Settings } from '@openedx/paragon/icons';
22+
23+
const config = {
24+
pluginSlots: {
25+
'org.openedx.frontend.authoring.additional_course_plugin.v1': {
26+
plugins: [
27+
{
28+
op: PLUGIN_OPERATIONS.Hide,
29+
widgetId: 'default_contents',
30+
},
31+
{
32+
op: PLUGIN_OPERATIONS.Insert,
33+
widget: {
34+
id: 'custom_additional_course',
35+
type: DIRECT_PLUGIN,
36+
RenderWidget: () => (
37+
<Card className={'shadow justify-content-between'} >
38+
<Card.Header
39+
title={'Additional Course'}
40+
subtitle={(
41+
<Badge variant="success" className="mt-1">
42+
slot props course
43+
</Badge>
44+
)}
45+
actions={<Settings />}
46+
size="sm"
47+
/>
48+
<Card.Body>
49+
<Card.Section>
50+
Additional course from slot props description.
51+
Or anything else.
52+
</Card.Section>
53+
</Card.Body>
54+
</Card>
55+
),
56+
},
57+
},
58+
]
59+
}
60+
},
61+
}
62+
63+
export default config;
64+
```
324 KB
Loading

0 commit comments

Comments
 (0)