File tree Expand file tree Collapse file tree 2 files changed +59
-1
lines changed
src/plugin-slots/AdditionalCoursePluginSlot Expand file tree Collapse file tree 2 files changed +59
-1
lines changed Original file line number Diff line number Diff line change 1
- # AdditionalCoursePluginSlot
1
+ # Additional Course Plugin Slot
2
2
3
3
### Slot ID: ` org.openedx.frontend.authoring.additional_course_plugin.v1 `
4
4
5
5
### Slot ID Aliases
6
6
* ` 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
+ ```
You can’t perform that action at this time.
0 commit comments