File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,22 @@ Then run the Moodle upgrade as normal.
34
34
35
35
https://docs.moodle.org/en/Installing_plugins
36
36
37
+ Step 2: Create a new content type
38
+ -----------------------------------
39
+
40
+ Visit Admin > Plugins > CMS > Manage content types and create a new type. Each type has data
41
+ sources which can add which provide various data to your template, for example the
42
+ 'Custom fields' data type will let you define custom fields which are editable in module
43
+ settings page and those fields will be availanle for use in your template. The 'Roles list'
44
+ source will provide a dynamic list of anyone who has a specified role in the course, eg
45
+ you could display a list of all the course teachers and tutors, and what role they have.
46
+
47
+ Once you have defined the data source then you configure a mustache template to display that data
48
+ on the course page. To see the raw data the ` {{{debug}}} ` mustache variable shows you the complete
49
+ copy of the templates input context. You can see a basic preview however it is likely easier
50
+ to go and create a new instance of your content type in a course. Turn on editing mode, add a
51
+ new activty, and you should see your new content type in the chooser.
52
+
37
53
## Data sources
38
54
39
55
Extra detail can be added to CMSs and CMS types via data sources. Within your plugin, add classes that derive from
You can’t perform that action at this time.
0 commit comments