How to add renderers and templates to your Moodle Plugin – Tutorial by Mike Churchward #Moodledev

AI in Education Leaderboard Post Page
Ai In Education Square Post Page

--- Advertisement ---

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:

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']

Leave a Reply

Your email address will not be published. Required fields are marked *

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

The Latest

The eLearn Podcast

--- Advertisement ---

Subscribe to our newsletter

Education technology has the power to change lives. 

To get the latest news, information and resources about online learning from around the world by clicking on the button below.