
Learn to build a Moodle block with PHP by creating a functional plugin, detailing folder structure, language and access files, versioning, the main block file, and settings.
Explore what a block is in Moodle, how blocks act as draggable, configurable plugins you add to dashboard areas, set visibility and permissions, and customize their position and content.
Build a Moodle PHP block that displays a YouTube playlist viewer via a web service, configurable per instance with a playlist id and video count.
Set up a new Moodle block by creating a unique folder in blocks, adding a DB and lang folder, and building the PHP file structure for a YouTube playlist block.
Learn to create and version a Moodle block by adding the version file. Set the plugin version, component name, and minimum Moodle version to ensure correct updates and compatibility.
Learn how to create a Moodle block access file and define capabilities to control who can add or manage the block across courses and dashboards.
Create a Moodle block language file in PHP by adding an English language folder, naming the file block_<name>, and defining the plug in name for installation.
Create a Moodle block by adding the main block file, extending the block base class, initializing the plugin title from language strings, and implementing get_content to display the block content.
Install and verify the Moodle block, upgrade the database, and add the YouTube playlist viewer to the front page, then configure global and instance settings.
Learn how to create a Moodle block that pulls a YouTube playlist RSS feed as XML, using PHP to fetch content, handle errors, and convert it with SimpleXML for display.
Learn to add YouTube thumbnails to a Moodle block by extracting video IDs, building thumbnail URLs, and using Bootstrap for a responsive layout.
Add per-block configuration to the Moodle YouTube playlist block with an edit_form.php. Define fields for the playlist id, title, and items to display.
Learn to create global administration settings for a Moodle block by adding a settings file, enabling has_config, and loading a YouTube RSS URL from get_config to display a playlist.
Create a Moodle block with PHP, configure settings and permissions, install it, and place it in content areas and the default dashboard. Add a YouTube playlist viewer for training videos.
This course will take you through the complete process of developing a Moodle block. A 'block' is a special type of plugin that is used in Moodle that can be added to pages, dashboards and other display areas in Moodle. A 'block' has a unique set of requirements when developing in Moodle that will be covered in this course.
It is highly recommended that you have PHP, HTML, JavaScript and CSS experience before attempting to create a block in Moodle but it is not essential that you have worked in Moodle before.
This course will teach you the basic structure and requirements of a 'block', then take you through the actual process of:
Creating a fully functioning block
Adding the core files
Managing plugin versions
Adding the access file
Adding instance configuration options
Adding global config options
Adding the language file for the block
Completing a YouTube playlist RSS reader function to demonstrate the block
Publishing the plugin to your Moodle LMS
The block process is recorded using Moodle 3.9 but the code can be used in Moodle 3.7.2.
This course is primarily for PHP developers, but if you have understand other programming languages you should be able to easily transfer your programming knowledge to PHP and to this course.