A Moodle renderer is a class that handles all the output for a component of Moodle and it should not contain any logic other than what is required to generate the display. This is the standard description of a Moodle renderer but how to make full use of the Moodle renderers and code the display logic for your plugin.
Introduced in Moodle 2.0, Moodle renderers are now expanded to make use of the templates, using the Mustache templating language. The use of templating language enabled the separation of HTML from PHP/JavaScript to allow the theme designers more creatively.
If you are also getting started with the Moodle theming and would like to learn about the renderers and templating then you can get started with this Moodle docs guide and this guide. However, if you would like to refer a practical hands on experience with overriding the renderers and templating mechanism in a plugin, then here is nice hands on tutorial for you.
The tutorial series written by Mike Churchward, Executive Director of POET group is good starting point for all Moodle theme designers who would like to get started with the Moodle renderers and templates. During the hands on experience tutorial, Mike refactored the “Questionnaire” plugin and improved the plugin output. The tutorial series covers the following topics:

Post Pages - Post Inline - WIRIS

There is another video demo by Damyon Wiese showing the JavaScript, Ajax and templates in Moodle recorded during the MoodleMoot Australia 2015 Hackfest. Check it out below:

Are you using the renderers in your Moodle plugin? Share your experience with us in the comments section below.

[ulp id='ntmi4JeMQ49mpBRm']

Previous articleMoodle Quiz: The Video Game, Thanks To This Plugin
Next articleWant to simplify the activity chooser in Moodle? Vote for this tracker issue to include it in Moodle core #moodle


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.