Skip to content

Commit dfcbf0d

Browse files
Update README.md
1 parent 49bce68 commit dfcbf0d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ Then run the Moodle upgrade as normal.
3434

3535
https://docs.moodle.org/en/Installing_plugins
3636

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+
3753
## Data sources
3854

3955
Extra detail can be added to CMSs and CMS types via data sources. Within your plugin, add classes that derive from

0 commit comments

Comments
 (0)