<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stuartrmealor</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stuartrmealor"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Stuartrmealor"/>
	<updated>2026-06-07T19:42:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Themes&amp;diff=55653</id>
		<title>Themes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Themes&amp;diff=55653"/>
		<updated>2019-03-07T02:48:55Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a starting point for Moodle theme developers.&lt;br /&gt;
&lt;br /&gt;
For documentation on installing and using themes, please see the [[:en:Themes|Themes user documentation]] and [[:en:Themes FAQ|Themes FAQ]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Moodle has a powerful themes system that allows for a variety of effects through the use of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
* [[Themes overview]]&lt;br /&gt;
* [[Creating a theme based on boost]]&lt;br /&gt;
* [[Creating a theme based on classic]]&lt;br /&gt;
* [[Moving your theme to use boost as a parent theme]]&lt;br /&gt;
* [[Updating a boost based theme]]&lt;br /&gt;
* [[Using images in a theme|Using images]]&lt;br /&gt;
* [[Creating a theme settings page|Theme settings page]]&lt;br /&gt;
* [[Adding theme upgrade code]]&lt;br /&gt;
* [[Extending the theme custom menu|Extending the custom menu]]&lt;br /&gt;
* [[Overriding a renderer]]&lt;br /&gt;
* [[Theme checklist]]&lt;br /&gt;
* [[Templates]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Themes|List of all themes-related developer documentation]]&lt;br /&gt;
* [http://youtu.be/K3MYE8am7M4 Install a New Theme]  MoodleBites video on YouTube &lt;br /&gt;
* Moodle Partner online courses for Theme designers [https://www.moodlebites.com/mod/page/view.php?id=3208 Level 1] (foundation) and [https://www.moodlebites.com/mod/page/view.php?id=3210 Level 2] (advanced)&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Themes_overview&amp;diff=55548</id>
		<title>Themes overview</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Themes_overview&amp;diff=55548"/>
		<updated>2019-02-05T03:13:19Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: /* The different layouts as of 21st April 2013 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}&lt;br /&gt;
Welcome to the new world of themes in Moodle!&lt;br /&gt;
&lt;br /&gt;
A Moodle theme allows the user to change the look and feel of a Moodle site.  Themes can be applied on the site, category, course and activity levels by users with permissions to do so.  Themes can be designed for specific devices such as mobile phones or tablets. This page explains how themes work in Moodle and is intended to help you create or modify most themes for Moodle.&lt;br /&gt;
&lt;br /&gt;
You can use contributed themes or create your entire own to share with the community. Themes can also be based on parent themes with only few customizations. Themes accomplish this using CSS, changing the underlying markup structure and also adding Javascript to add more advanced behaviors.&lt;br /&gt;
&lt;br /&gt;
Most theme developers simply add a few changes to their new theme by basing it on an existing one. The Moodle Theme architecture is designed in such a way whereby the base theme will act as a fall-back that is used when nothing has been defined in the theme based on it. This makes it easy to create new themes that simply seek out to make minor changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Whats new?==&lt;br /&gt;
&lt;br /&gt;
When Moodle releases a new version. All changes that affect themes are listed in the theme/upgrade.txt file. This is the most up-to date place to find about all changes to a specific version of Moodle and will always be kept up to date. &lt;br /&gt;
&lt;br /&gt;
[https://github.com/moodle/moodle/blob/master/theme/upgrade.txt View upgrade notes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The structure of a theme==&lt;br /&gt;
&lt;br /&gt;
Some important things to know when building good themes:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;config.php&#039;&#039;&#039; - this file is required in every theme.  It defines configuration settings and definitions required to make the theme work in Moodle. These include theme, file, region, default region and options. &lt;br /&gt;
# &#039;&#039;&#039;Layouts and layout files&#039;&#039;&#039; -  in config.php there is one definition for each page type (see [[#theme_layouts_table|Appendix A: Theme layouts]] for a list of over 12 types).  Each page type definition tells Moodle which layout file will be used, what block regions this page type should display and so on.  The layout file contains the HTML and the minimum PHP required to display basic structure of pages.&lt;br /&gt;
# &#039;&#039;&#039;The boost theme&#039;&#039;&#039; - is intended to be the best theme to use as a starting point for building a new theme. It supports all the latest theme features and it tries to stay as true to the [http://getbootstrap.com/ Bootstrap] css framework as possible. [[Creating a theme based on boost]] &lt;br /&gt;
&lt;br /&gt;
===Files and folders===&lt;br /&gt;
A theme&#039;s files are placed in a folder with under moodle/theme folder and have subfolders. They are laid out like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Directory&lt;br /&gt;
! File&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /&lt;br /&gt;
| config.php&lt;br /&gt;
| Contains all of the configuration and definitions for each theme&lt;br /&gt;
|-&lt;br /&gt;
| /&lt;br /&gt;
| lib.php &lt;br /&gt;
| Contains speciality functions that are used by theme&lt;br /&gt;
|-&lt;br /&gt;
| /classes&lt;br /&gt;
| *.php&lt;br /&gt;
| Contains auto-loaded classes for the theme. See [[Automatic class loading]] for more details.&lt;br /&gt;
|-&lt;br /&gt;
| /classes/output&lt;br /&gt;
| *.php&lt;br /&gt;
| This is the location for the theme to define overridden renderers. See [[Output renderers]] for more details.&lt;br /&gt;
|-&lt;br /&gt;
| /&lt;br /&gt;
| settings.php &lt;br /&gt;
| Contains custom theme settings. These local settings are defined by the theme allowing an administrator to easily alter something about the way it looks or operates. (eg a background colour, or a header image)&lt;br /&gt;
|-&lt;br /&gt;
| /&lt;br /&gt;
| version.php &lt;br /&gt;
| Contains the theme name, version number and Moodle version requirements for using the theme&lt;br /&gt;
|-&lt;br /&gt;
| /fonts/&lt;br /&gt;
| *.woff, *.ttf, *.eot, *.svg, *.otf&lt;br /&gt;
| Theme fonts (since 2.6).&lt;br /&gt;
|-&lt;br /&gt;
| /fonts_core/ &lt;br /&gt;
| *.woff, *.ttf, *.eot, *.svg, *.otf&lt;br /&gt;
| Contains fonts that override standard core fonts (since 2.6).&lt;br /&gt;
|-&lt;br /&gt;
| /fonts_plugins/plugintype/pluginname/ &lt;br /&gt;
| *.woff, *.ttf, *.eot, *.svg, *.otf&lt;br /&gt;
| Contains fonts that override plugin fonts (since 2.6).&lt;br /&gt;
|-&lt;br /&gt;
| /amd/src/ &lt;br /&gt;
| *.js&lt;br /&gt;
| All specialty JavaScript files the theme requires should be located in here. Javascript should be written as an AMD module. For more information see [[Javascript Modules]]. &lt;br /&gt;
|-&lt;br /&gt;
| /lang/[langcode]/&lt;br /&gt;
| *.php&lt;br /&gt;
| Any special language files the theme requires should be located in here. &lt;br /&gt;
|-&lt;br /&gt;
| /templates/ &lt;br /&gt;
| *.mustache&lt;br /&gt;
| Contains the mustache template files for the themes. (Including overridden ones). See [[Templates]] for more information.&lt;br /&gt;
|-&lt;br /&gt;
| /layout/ &lt;br /&gt;
| *.php&lt;br /&gt;
| Contains the layout files for the theme.&lt;br /&gt;
|-&lt;br /&gt;
| /pix/ &lt;br /&gt;
| *.png, *.jpg, *.gif, *.svg&lt;br /&gt;
| Contains any images the theme makes use of either in CSS or in the layout files.&lt;br /&gt;
|-&lt;br /&gt;
|  /pix/&lt;br /&gt;
| favicon.ico &lt;br /&gt;
| The favicon to display for this theme.&lt;br /&gt;
|-&lt;br /&gt;
| /pix/&lt;br /&gt;
| screenshot.png &lt;br /&gt;
| A screenshot of the theme to be displayed in on the theme selection screen.&lt;br /&gt;
|-&lt;br /&gt;
| /pix_core/ &lt;br /&gt;
| *.png, *.jpg, *.gif, *.svg&lt;br /&gt;
| Contains images that override standard core images.&lt;br /&gt;
|-&lt;br /&gt;
| /pix_plugins/plugintype/pluginname/ &lt;br /&gt;
| *.png, *.jpg, *.gif, *.svg&lt;br /&gt;
| Contains images that override plugin images.&lt;br /&gt;
|-&lt;br /&gt;
| /style/&lt;br /&gt;
| *.css&lt;br /&gt;
| Default location for CSS files.&lt;br /&gt;
|-&lt;br /&gt;
| /less/&lt;br /&gt;
| *.less&lt;br /&gt;
| Default location for Less files if your theme uses less.&lt;br /&gt;
|-&lt;br /&gt;
| /scss/&lt;br /&gt;
| *.scss&lt;br /&gt;
| Default location for SCSS files if your theme uses SCSS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There are also several other places that stylesheets can be included from (see the CSS how and why section below).&lt;br /&gt;
&lt;br /&gt;
It is possible to override icons used in base themes without interfering with core code by placing these in dataroot/pix and dataroot/pix_plugins. Where a theme extends a base theme and provides its own icons, these icons will still be used.&lt;br /&gt;
&lt;br /&gt;
It is possible to override mustache templates used in base themes without interfering with core code by placing these in templates/[componentname]/[templatename].mustache.&lt;br /&gt;
&lt;br /&gt;
==Theme options==&lt;br /&gt;
All theme options are set within the config.php file for the theme.  The settings that are most used are: parents, sheets, layouts, and javascripts. Have a look at the &#039;&#039;&#039;[[#theme_options_table|theme options table]]&#039;&#039;&#039; for a complete list of theme options which include lesser used specialised or advanced settings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Basic theme config example===&lt;br /&gt;
Lets have a look at the boost theme configuration file and the different bits that make it up:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&lt;br /&gt;
require_once(__DIR__ . &#039;/lib.php&#039;);&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boost&#039;;&lt;br /&gt;
$THEME-&amp;gt;sheets = [];&lt;br /&gt;
$THEME-&amp;gt;editor_sheets = [];&lt;br /&gt;
$THEME-&amp;gt;scss = function($theme) {&lt;br /&gt;
    return theme_boost_get_main_scss_content($theme);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;layouts = [&lt;br /&gt;
    // Most backwards compatible layout without the blocks - this is the layout used by default.&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns1.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information.&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Main course page.&lt;br /&gt;
    &#039;course&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;coursecategory&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Part of course, typical for modules - default page layout if $cm specified in require_login().&lt;br /&gt;
    &#039;incourse&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The site home page.&lt;br /&gt;
    &#039;frontpage&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nonavbar&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Server administration scripts.&lt;br /&gt;
    &#039;admin&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // My dashboard page.&lt;br /&gt;
    &#039;mydashboard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // My public page.&lt;br /&gt;
    &#039;mypublic&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;login&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;login.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    // Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns1.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // No blocks and minimal footer - used for legacy frame layouts only!&lt;br /&gt;
    &#039;frametop&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns1.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nocoursefooter&#039; =&amp;gt; true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.&lt;br /&gt;
    &#039;embedded&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array()&lt;br /&gt;
    ),&lt;br /&gt;
    // Used during upgrade and install, and for the &#039;This site is undergoing maintenance&#039; message.&lt;br /&gt;
    // This must not have any blocks, links, or API calls that would lead to database or cache interaction.&lt;br /&gt;
    // Please be extremely careful if you are modifying this layout.&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;maintenance.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Should display the content and basic headers only.&lt;br /&gt;
    &#039;print&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns1.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; false),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used when a redirection is occuring.&lt;br /&gt;
    &#039;redirect&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for reports.&lt;br /&gt;
    &#039;report&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The pagelayout used for safebrowser and securewindow.&lt;br /&gt;
    &#039;secure&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;secure.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;&lt;br /&gt;
    )&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;parents = [];&lt;br /&gt;
$THEME-&amp;gt;enable_dock = false;&lt;br /&gt;
$THEME-&amp;gt;csstreepostprocessor = &#039;theme_boost_css_tree_post_processor&#039;;&lt;br /&gt;
$THEME-&amp;gt;extrascsscallback = &#039;theme_boost_get_extra_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;prescsscallback = &#039;theme_boost_get_pre_scss&#039;;&lt;br /&gt;
$THEME-&amp;gt;yuicssmodules = array();&lt;br /&gt;
$THEME-&amp;gt;rendererfactory = &#039;theme_overridden_renderer_factory&#039;;&lt;br /&gt;
$THEME-&amp;gt;undeletableblocktypes = &#039;&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Basic theme example settings explained===&lt;br /&gt;
First up you will notice everything is added to $THEME. This is the theme&#039;s configuration object, it is created by Moodle using default settings and is then updated by whatever settings you add to it.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;name : The first setting, is the theme&#039;s name. This should simply be whatever your theme&#039;s name is, most likely whatever you named your theme directory.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;sheets : An array containing the names of the CSS stylesheets to include for this theme. Boost uses scss instead of css so it doesn&#039;t list any files here. Note that it is just the name of the stylesheet and does not contain the directory or the file extension. Moodle assumes that the theme&#039;s stylesheets will be located in the styles directory of the theme and have .css as an extension.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;editorsheets : An array containing the names of the CSS stylesheets to include for the TinyMCE text editor content area. Boost does not list any stylesheets here so TinyMCE will use plain text styles.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;layouts : In this example, boost maps each of the 18 different layout types to one of 6 different layout files. For more information see the [[#Layouts|layouts]] section below.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;parents : This defines the themes that the theme will extend. Boost has no parents, but if you were extending boost you would list it here like: $THEME-&amp;gt;parents = [&#039;boost&#039;];&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;enable_dock : Boost does not support docking blocks. For a example of a theme with a dock for blocks, see theme_bootstrapbase.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;csstreepostprocessor : Boost uses a function to post process the CSS. This is an advanced feature and is used in boost to automatically apply vendor prefixes to CSS styles.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;yuicssmodules : This is an old setting that defines a list of YUI css files to load. These files interfere with existing styles and it is recommended to set this to an empty string to prevent any files being included.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;rendererfactory : Almost all themes need this setting to be set to &#039;theme_overridden_renderer_factory&#039; or the theme will not be able to customise any core renderers.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;undeletableblocktypes : This is a comma separated list of block types that cannot be deleted in this theme. If you don&#039;t define this - the admin and settings blocks will be undeletable by default. Because Boost provides alternate ways to navigate it does not require any blocks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;&#039;&#039;: When you first begin writing themes, make sure you take a look at the configuration files of the other themes that get shipped with Moodle. You will get a good picture of how everything works, and what is going on in a theme, simply by reading it and taking notice of what it is including or excluding.&lt;br /&gt;
&lt;br /&gt;
==CSS==&lt;br /&gt;
===Locations of CSS files===&lt;br /&gt;
First lets look at where CSS can be included from within Moodle:&lt;br /&gt;
; \theme\themename\style\*.css : This is the default location for all of the stylesheets that are used by a theme and the place which should be used by a theme designer if this theme is using CSS. Alternatives to CSS are LESS and SCSS which are more powerful, flexible and easier to maintain.&lt;br /&gt;
&lt;br /&gt;
New theme developers should note that the order in which CSS files are found and included creates a hierarchy.  This order ensures that the rules, within a theme&#039;s style sheets, take precedence over identical rules in other files that may have been introduced before.  This can both extend another files definitions (see parent array in the config file) and also ensures that the current theme&#039;s CSS rules/definitions have the last say.&lt;br /&gt;
&lt;br /&gt;
There are other locations that can be used (although very rarely) to include CSS in a page. A developer of a php file can manually specify a stylesheet from anywhere within Moodle, like the database. Usually, if code is doing this, it is because there is a non-theme config or plugin setting that contains information requires special CSS information.  As a theme designer you should be aware of, but not have to worry about, these locations of CSS files.  Here are some examples:&lt;br /&gt;
&lt;br /&gt;
; {pluginpath}\styles.css e.g. \block\blockname\styles.css or \mod\modname\styles.css : Every plugin can have its own styles.css file. This file should only contain the required CSS rules for the module and should not add anything to the look of the plugin such as colours, font sizes, or margins other than those that are truly required.&amp;lt;br /&amp;gt;Theme specific styles for a plugin should be located within the themes styles directory.&lt;br /&gt;
; {pluginpath}\styles_themename.css : This should only ever be used by plugin developers. It allows them to write CSS that is designed for a specific theme without having to make changes to that theme. You will notice that this is never used within Moodle and is designed to be used only by contributed code.&lt;br /&gt;
&lt;br /&gt;
As theme designers, we will only use the first method of introducing CSS: adding rules to a stylesheet file located in the theme&#039;s style directory.&lt;br /&gt;
===Better than CSS===&lt;br /&gt;
Browsers understand CSS well - but it is hard to write and maintain. The language does not support inheritance and reuse and does not allow configuration with variables. This is why CSS pre-processors were invented. Moodle supports 2 different types of CSS pre-processors (Less and Sass) but the Sass pre-processor is recommended by far. &lt;br /&gt;
&lt;br /&gt;
For more information on Less and Sass see: &lt;br /&gt;
* [https://en.wikipedia.org/wiki/Less_(stylesheet_language) Less (wikipedia)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Sass_(stylesheet_language) Sass (wikipedia)]&lt;br /&gt;
&lt;br /&gt;
To use either one, define $THEME-&amp;gt;lessfile = &#039;filename&#039;; or $THEME-&amp;gt;scss = &#039;filename&#039;; in your themes config.php. Moodle will then use one of it&#039;s in-built CSS pre-processor to compile the CSS the first time it is loaded (or everytime if themedesignermode is enabled in $CFG).&lt;br /&gt;
&lt;br /&gt;
===Moodle&#039;s core CSS organisation===&lt;br /&gt;
The next thing to look at is the organisation of CSS and rules within a theme. Although as a theme designer it is entirely up to you as to how you create and organise your CSS. Please note that none of the themes provided in the standard install by Moodle use CSS stylesheets directly. Instead they use either LESS or SCSS to generate the style sheets. They all list one main LESS or SCSS file named &amp;quot;moodle&amp;quot; in the less or scss folders and this file uses imports to load all other required files.&lt;br /&gt;
&lt;br /&gt;
===How to write effective CSS rules within Moodle===&lt;br /&gt;
Writing good CSS rules is incredibly important.&lt;br /&gt;
&lt;br /&gt;
Due to performance requirements and browser limitations, all of the CSS files are combined into a single CSS file that gets included every time. This means that rules need to be written in such a way as to minimise the chances of a collision leading to unwanted styles being applied. Whilst writing good CSS is something most designers strive for we have implemented several new body classes and prompt developers to use appropriate classnames.&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;body&amp;gt; CSS id and classes ====&lt;br /&gt;
The ID tag that gets applied to the body will always be a representation of the URI. For example if you are looking at a forum posting and the URI is &#039;/mod/forum/view.php&#039; then the body tags ID will be &#039;#page-mod-forum-view&#039;.&lt;br /&gt;
&lt;br /&gt;
As well as the body&#039;s ID attribute the URI is also exploded to form several CSS classes that get added to the body tag, so in the above example &#039;/mod/forum/view&#039; you would end up with the following classes being added to the body tag &#039;.path-mod&#039;, &#039;.path-mod-forum&#039;. Note that &#039;.path-mod-forum-view&#039; is not added as a class, this is intentionally left out to lessen confusion and duplication as rules can relate directly to the page by using the ID and do not require the final class.&lt;br /&gt;
&lt;br /&gt;
The body ID and body classes described above will form the bread and butter for many of the CSS rules you will need to write for your theme, however there are also several other very handy classes that get added to the body tag that will be beneficial to you once you start your journey down the rabbit hole that is themeing. Some of the more interesting classes are listed below.&lt;br /&gt;
&lt;br /&gt;
* If JavaScript is enabled then &#039;jsenabled&#039; will be added as a class to the body tag allowing you to style based on JavaScript being enabled or not.&lt;br /&gt;
* Either &#039;dir-rtl&#039; or &#039;dir-ltr&#039; will be added to the body as a class depending on the direction of the language pack: rtl = right to left, ltr = left to right. This allows you to determine your text-alignment based on language if required.&lt;br /&gt;
* A class will be added to represent the language pack currently in use, by default en_utf8 is used by Moodle and will result in the class &#039;lang-en_utf8&#039; being added to the body tag.&lt;br /&gt;
* The wwwroot for Moodle will also be converted to a class and added to the body tag allowing you to stylise your theme based on the URL through which it was reached. e.g. http://sam.moodle.local/moodle/ will become &#039;.sam-moodle-local—moodle&#039;&lt;br /&gt;
* If the current user is not logged then &#039;.notloggedin&#039; will be added to the body tag.&lt;br /&gt;
* The course format type will be added such as format-weeks&lt;br /&gt;
* The course id, context id and category id are all added as in &amp;quot;course-11 context-616 cmid-202 category-1&amp;quot;&lt;br /&gt;
* The pagelayout is added as &amp;quot;pagelayout-incourse&amp;quot;&lt;br /&gt;
&lt;br /&gt;
What does all of this look like in practise? Well using the above example /mod/forum/view.php you would get at least the following body tag:&lt;br /&gt;
&amp;lt;code html&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;page-mod-forum-view&amp;quot; class=&amp;quot;format-weeks forumtype-social  path-mod path-mod-forum safari dir-ltr lang-en yui-skin-sam yui3-skin-sam damyon-per-in-moodle-com--stable_master pagelayout-incourse course-11 context-616 cmid-202 category-1  jsenabled&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Writing your rules====&lt;br /&gt;
&lt;br /&gt;
By following the [[CSS coding style]] and CSS best-practices and understanding the [http://htmlhelp.com/reference/css/structure.html#cascade cascading order] of CSS a theme developer will reduce collisions and lines of CSS that is written. CSS classes have been placed where it is believed anyone may want to apply their own styles.&lt;br /&gt;
&lt;br /&gt;
When starting to write rules make sure that you have a good understanding of where you want those rules to be applied, it is a good idea to make the most of the body classes mentioned above.&lt;br /&gt;
If you want to write a rule for a specific page make use of the body tag&#039;s ID, e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;#page-mod-forum-view .forumpost {&lt;br /&gt;
    border: 1px solid blue;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to write a rule that will be applied all throughout the forum.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;.path-mod-forum .forumpost {&lt;br /&gt;
    border: 1px solid blue;&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The other very important thing to take into consideration is the structure leading up to the tag you want to style. Browsers apply conflicting styles with priority on the more specific selectors. It can be very beneficial to keep this in mind and write full selectors that rely on the structure of the tags leading to the tag you wish to style.&lt;br /&gt;
&lt;br /&gt;
By making use of body id&#039;s and classes and writing selectors to take into account the leading structure you can greatly minimise the chance of a collision both with Moodle now and in the future.&lt;br /&gt;
&lt;br /&gt;
It is also important to write as FEW rules as possible. CSS is extremely hard to maintain and lots of CSS is bad for client side performance. Themes based on the Bootstrap CSS framework can achieve most things without writing a single additional CSS rule. Please read [http://v4-alpha.getbootstrap.com/ the Bootstrap documentation] and learn how to use Bootstrap well to avoid adding unnecessary CSS rules for things already provided by the framework.&lt;br /&gt;
&lt;br /&gt;
==Layouts==&lt;br /&gt;
Layouts are defined in &#039;&#039;&#039;config.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
All themes are required to define the layouts they wish to be responsible for as well as create; however, many layout files are required by those layouts. If the theme is overriding another theme then it is a case of deciding which layouts this new theme should override. If the theme is a completely fresh start then you will need to define a layout for each of the different possibilities. &lt;br /&gt;
&lt;br /&gt;
It is also important to note that a new theme that will base itself on another theme (overriding it) does not need to define any layouts or use any layout files if there are no changes that it wishes to make to the layouts of the existing theme.&lt;br /&gt;
&lt;br /&gt;
As mentioned earlier, layouts are defined in config.php within $THEME-&amp;gt;layouts. The following is an example of one such layout definition:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts = array(&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;boost&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns2.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;&lt;br /&gt;
    )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first thing Moodle looks at is the name of the layout, in this case it is `standard` (the array key in PHP), it then looks at the settings for the layout, this is the theme, file, regions, and default region. There are also a couple of other options that can be set by a layout.&lt;br /&gt;
&lt;br /&gt;
; theme : is the theme the layout file exists in. That&#039;s right: you can make use of layouts from other installed themes. &#039;&#039;Optional&#039;&#039;&lt;br /&gt;
; file : is the name of the layout file this layout wants to use. &#039;&#039;Required&#039;&#039;&lt;br /&gt;
; regions : is the different block regions (places you can put blocks) within the theme. &#039;&#039;Required&#039;&#039;&lt;br /&gt;
; defaultregion : is the default location when adding new blocks. &#039;&#039;&#039;Required if regions is non-empty, otherwise optional&#039;&#039;&#039;&lt;br /&gt;
; options : an array of layout specific options described in detail below. &#039;&#039;&#039;Optional&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;theme&#039;&#039;&#039; is optional. Normally the the layout file is looked for in the current theme, or, if it is not there, in the parent theme. However, you can use a layout file from any other theme by giving the theme name here.&lt;br /&gt;
&lt;br /&gt;
You can define whatever regions you like. You just need to pick a name for each one. Most themes just use one or both of &#039;&#039;&#039;side_pre&#039;&#039;&#039; and &#039;&#039;&#039;side_post&#039;&#039;&#039;, which is like &#039;left side&#039; and &#039;right side&#039;, except in right to left languages, when they are reversed. If you say in config.php that your the layout provides regions called &#039;fred&#039; and &#039;barney&#039;, then you must call $OUTPUT-&amp;gt;blocks_for_region(&#039;fred&#039;) and $OUTPUT-&amp;gt;blocks_for_region(&#039;barney&#039;) somewhere in the layout file.&lt;br /&gt;
&lt;br /&gt;
The final setting &#039;&#039;&#039;options&#039;&#039;&#039; is a special case that only needs to be set if you want to make use of it. This setting allows the theme designer to specify special options that they would like to create that can be later accessed within the layout file. This allows the theme to make design decisions during the definition and react upon those decisions in what ever layout file is being used.&lt;br /&gt;
&lt;br /&gt;
One such place this has been used is within the boost theme. If you take a look first at theme/boost/config.php you will notice that several layouts specify options &#039;&#039;&#039;langmenu&#039;&#039;&#039; and &#039;&#039;&#039;nonavbar&#039;&#039;&#039; which can both be set to either true or false. The layout options can then be used on the layout .php files, mustache templates and renderers.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$hasnavbar = (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar());&lt;br /&gt;
$hasfooter = (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;]));&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout files==&lt;br /&gt;
Layout files are used to provide a different layout of the elements of the page for different types of pages in Moodle.&lt;br /&gt;
&lt;br /&gt;
In the config.php for a theme - there is a list of &#039;layouts&#039; which map a page type to a specific php page in the layout folder for the theme.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&#039;&#039;theme/boost/config.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(                                                                                                               &lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;columns1.php&#039;,                                                                                                   &lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),                                                                                                       &lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039; =&amp;gt; true, &#039;nonavbar&#039; =&amp;gt; true),                                                                 &lt;br /&gt;
    ),                                &lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means every page that has pagetype &#039;popup&#039; will be displayed with the &#039;theme/themename/layout/columns1.php&#039; file, it will have no block regions and there are some options that will be available to the page in the global variable &amp;quot;$PAGE-&amp;gt;layout_options&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
It is possible to implement a layout file directly in php by echoing the HTML for the page, or mixing php tags with HTML - but a better way to create a layout file is to gather all the information required for the layout into a context and render it with a mustache template. &lt;br /&gt;
&lt;br /&gt;
[[Templates| Read about mustache templates]]&lt;br /&gt;
&lt;br /&gt;
Using templates for layout files makes a lot of sense because they are easier to read and maintain than mixing PHP and HTML in the same file.&lt;br /&gt;
&lt;br /&gt;
A simple example of a layout file using a template is at:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/boost/layout/columns1.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$bodyattributes = $OUTPUT-&amp;gt;body_attributes([]);                                                                                     &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
$templatecontext = [                                                                                                                &lt;br /&gt;
    &#039;sitename&#039; =&amp;gt; format_string($SITE-&amp;gt;shortname, true, [&#039;context&#039; =&amp;gt; context_course::instance(SITEID), &amp;quot;escape&amp;quot; =&amp;gt; false]),        &lt;br /&gt;
    &#039;output&#039; =&amp;gt; $OUTPUT,                                                                                                            &lt;br /&gt;
    &#039;bodyattributes&#039; =&amp;gt; $bodyattributes                                                                                             &lt;br /&gt;
];                                                                                                                                  &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_boost/columns1&#039;, $templatecontext);  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example puts some variables into a templatecontext and then calls &amp;quot;render_from_template&amp;quot; to render the mustache template for this layout. The template is located at: &amp;quot;theme/boost/templates/columns1.mustache&amp;quot;. It is possible to put PHP classes in the context for the mustache template - and any public properties or methods which accept no arguments will be available to the template. $OUTPUT has several useful public methods which accept no arguments and is a valuable class when creating a layout template in mustache.&lt;br /&gt;
&lt;br /&gt;
The mustache template for this layout is shown here:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/boost/templates/columns1.mustache&#039;&#039;&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
{{{ output.doctype }}}                                                                                                              &lt;br /&gt;
&amp;lt;html {{{ output.htmlattributes }}}&amp;gt;                                                                                                &lt;br /&gt;
&amp;lt;head&amp;gt;                                                                                                                              &lt;br /&gt;
    &amp;lt;title&amp;gt;{{{ output.page_title }}}&amp;lt;/title&amp;gt;                                                                                        &lt;br /&gt;
    &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{{{ output.favicon }}}&amp;quot; /&amp;gt;                                                                      &lt;br /&gt;
    {{{ output.standard_head_html }}}                                                                                               &lt;br /&gt;
    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;                                                          &lt;br /&gt;
&amp;lt;/head&amp;gt;                                                                                                                             &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
&amp;lt;body {{{ bodyattributes }}}&amp;gt;                                                                                                       &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
&amp;lt;div id=&amp;quot;page-wrapper&amp;quot;&amp;gt;                                                                                                             &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
    {{{ output.standard_top_of_body_html }}}                                                                                        &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
    &amp;lt;div id=&amp;quot;page&amp;quot; class=&amp;quot;container-fluid&amp;quot;&amp;gt;                                                                                         &lt;br /&gt;
        &amp;lt;div id=&amp;quot;page-content&amp;quot; class=&amp;quot;row&amp;quot;&amp;gt;                                                                                         &lt;br /&gt;
            &amp;lt;div id=&amp;quot;region-main-box&amp;quot; class=&amp;quot;col-xs-12&amp;quot;&amp;gt;                                                                            &lt;br /&gt;
                &amp;lt;section id=&amp;quot;region-main&amp;quot;&amp;gt;                                                                                          &lt;br /&gt;
                    &amp;lt;div class=&amp;quot;card card-block&amp;quot;&amp;gt;                                                                                   &lt;br /&gt;
                    {{{ output.course_content_header }}}                                                                            &lt;br /&gt;
                    {{{ output.main_content }}}                                                                                     &lt;br /&gt;
                    {{{ output.course_content_footer }}}                                                                            &lt;br /&gt;
                    &amp;lt;/div&amp;gt;                                                                                                          &lt;br /&gt;
                &amp;lt;/section&amp;gt;                                                                                                          &lt;br /&gt;
            &amp;lt;/div&amp;gt;                                                                                                                  &lt;br /&gt;
        &amp;lt;/div&amp;gt;                                                                                                                      &lt;br /&gt;
    &amp;lt;/div&amp;gt;                                                                                                                          &lt;br /&gt;
&amp;lt;/div&amp;gt;                                                                                                                              &lt;br /&gt;
{{{ output.standard_end_of_body_html }}}                                                                                            &lt;br /&gt;
&amp;lt;/body&amp;gt;                                                                                                                             &lt;br /&gt;
&amp;lt;/html&amp;gt;                                                                                                                             &lt;br /&gt;
{{#js}}                                                                                                                             &lt;br /&gt;
require([&#039;theme_boost/loader&#039;]);                                                                                                    &lt;br /&gt;
{{/js}} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explaining each line of this template will answer a lot of questions. This example contains only the very minimal required functions to generate a valid layout. You should consider all of the sections below as required in every layout file (although any of the HTML tags can and should be altered). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
{{{ output.doctype }}}                                                                                                              &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is an example of calling a function on $OUTPUT in php. Because there is a public method on the output class named &amp;quot;doctype&amp;quot; which accepts no arguments - mustache will call it and return the output. We call a function to generate the doctype tag because calling this function returns us the correct HTML for the document type for this theme AND it sets a different content type header (including the charset) depending on the doc type for the theme. Setting a correct charset in every page is important to prevent a class of XSS attacks. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
&amp;lt;html {{{ output.htmlattributes }}}&amp;gt;                                                                                                &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have returned our root tag - the html tag. We included a set of default attributes for the page by calling the htmlattributes function of our output class. This includes the correct language attribute for the entire page and can include an xml namespace for XHTML documents. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;                                                                                                                              &lt;br /&gt;
    &amp;lt;title&amp;gt;{{{ output.page_title }}}&amp;lt;/title&amp;gt;                                                                                        &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have started the head section of our document and set the title for the page. Notice the title is already escaped by the output class so we are using triple mustache tags &amp;quot;{{{&amp;quot; to avoid double escaping.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
    &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{{{ output.favicon }}}&amp;quot; /&amp;gt;                                                                      &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We call a function to get the url to the favicon. The favicon is a file in the theme pix directory and it is served through the &amp;quot;theme/image.php&amp;quot; file which adds special caching headers for images.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
    {{{ output.standard_head_html }}}                                                                                               &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The standard head html function performs a lot of setup that is required for our page. It internally creates the block regions, creates meta tags including keywords for SEO, initialises the common javascript modules, generates links to the style sheets and injects any additional HTML set by the $CFG-&amp;gt;additionalhtmlhead setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;                                                          &lt;br /&gt;
&amp;lt;/head&amp;gt;                                                                                                                             &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This viewport meta tag is recommended by bootstrap for &amp;quot;proper viewport rendering and touch zooming&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
&amp;lt;body {{{ bodyattributes }}}&amp;gt;                                                                                                       &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The body attributes include the language direction and standard classes for the page. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
&amp;lt;div id=&amp;quot;page-wrapper&amp;quot;&amp;gt;                                                                                                             &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the Boost theme we use a page-wrapper div to prevent content from disappearing under the fixed header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
    {{{ output.standard_top_of_body_html }}}                                                                                        &lt;br /&gt;
                                                                                                                                    &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The standard_top_of_body_html should be included in every layout and includes skip links for accessibility as well as initialising jquery, yui and our own static javascript files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page&amp;quot; class=&amp;quot;container-fluid&amp;quot;&amp;gt;                                                                                         &lt;br /&gt;
        &amp;lt;div id=&amp;quot;page-content&amp;quot; class=&amp;quot;row&amp;quot;&amp;gt;                                                                                         &lt;br /&gt;
            &amp;lt;div id=&amp;quot;region-main-box&amp;quot; class=&amp;quot;col-xs-12&amp;quot;&amp;gt;                                                                            &lt;br /&gt;
                &amp;lt;section id=&amp;quot;region-main&amp;quot;&amp;gt;                                                                                          &lt;br /&gt;
                    &amp;lt;div class=&amp;quot;card card-block&amp;quot;&amp;gt;                                                                                   &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is standard HTML tags defining the content region for this page. The classes come from bootstrap 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
                    {{{ output.course_content_header }}}                                                                            &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The course content header allows Moodle plugins to inject things in the top of the page. This is used for &amp;quot;notifications&amp;quot; for example (which are the alert boxes you see after submitting a form). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
                    {{{ output.main_content }}}                                                                                     &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main content function returns the real content for the page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
                    {{{ output.course_content_footer }}}                                                                            &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The course content footer is used mainly by course formats to insert things after the main content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;                                                                                                          &lt;br /&gt;
                &amp;lt;/section&amp;gt;                                                                                                          &lt;br /&gt;
            &amp;lt;/div&amp;gt;                                                                                                                  &lt;br /&gt;
        &amp;lt;/div&amp;gt;                                                                                                                      &lt;br /&gt;
    &amp;lt;/div&amp;gt;                                                                                                                          &lt;br /&gt;
&amp;lt;/div&amp;gt;                                                                                                                              &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We close all our open tags...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
{{{ output.standard_end_of_body_html }}}                                                                                            &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will add all of the javascript that was required while rendering the page. Javascript is added at the end of the document so that it does not block rendering the page. &lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;                                                                                                                             &lt;br /&gt;
&amp;lt;/html&amp;gt;                                                                                                                             &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We finish the HTML for our page. &lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
{{#js}}                                                                                                                             &lt;br /&gt;
require([&#039;theme_boost/loader&#039;]);                                                                                                    &lt;br /&gt;
{{/js}} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This final section is required for bootstrap 4 themes and loads all the Bootstrap 4 Javascript dependencies. &lt;br /&gt;
&lt;br /&gt;
If we had block regions in this layout we would need to insert them in the template. The way we would do this is by getting the HTML for the block region in our layout php file, adding it to the context and then including it in our template.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/boost/layout/columns2.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
$blockshtml = $OUTPUT-&amp;gt;blocks(&#039;side-pre&#039;);                                                                                          &lt;br /&gt;
$hasblocks = strpos($blockshtml, &#039;data-block=&#039;) !== false;&lt;br /&gt;
...&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
...&lt;br /&gt;
    &#039;sidepreblocks&#039; =&amp;gt; $blockshtml,                                                                                                 &lt;br /&gt;
    &#039;hasblocks&#039; =&amp;gt; $hasblocks,&lt;br /&gt;
...&lt;br /&gt;
];&lt;br /&gt;
...&lt;br /&gt;
echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_boost/columns2&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/boost/templates/columns2.mustache&#039;&#039;&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
                {{#hasblocks}}                                                                                                      &lt;br /&gt;
                &amp;lt;section data-region=&amp;quot;blocks-column&amp;quot; class=&amp;quot;hidden-print&amp;quot;&amp;gt;                                                          &lt;br /&gt;
                    {{{ sidepreblocks }}}                                                                                           &lt;br /&gt;
                &amp;lt;/section&amp;gt;                                                                                                          &lt;br /&gt;
                {{/hasblocks}} &lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When writing layout files think about the different layouts and how the HTML that each makes use of will differ. You will most likely find you do not need a different layout file for each layout, most likely you will be able to reuse the layout files you create across several layouts. You can of course make use of layout options as well to further reduce the number of layout files you need to produce.&lt;br /&gt;
&lt;br /&gt;
Of course as mentioned above if you are customising an existing theme then you may not need to create any layouts or layout files at all.&lt;br /&gt;
&lt;br /&gt;
==Language File==&lt;br /&gt;
&lt;br /&gt;
You need to create a language file for your theme with a few standard strings in it. At a minimum create a file called lang/en/theme_themename.php in your theme folder. For example, the &#039;boost&#039; theme has a language file called lang/en/theme_boost.php. &lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; define the following lines in your file (example is from Boost theme, adapt as required):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boost&#039;;&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Right&#039;;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Boost is a modern highly-customisable theme. This theme is intended to be used directly, or as a parent theme when creating new themes utilising Bootstrap 4.&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Without the above you will get notices for the missing strings.&lt;br /&gt;
&lt;br /&gt;
==Making use of images==&lt;br /&gt;
Right at the start when listing the features of the new themes system one of the features mentioned was the ability to override any of the standard images within Moodle from within your theme. At this point we will look at both how to make use of your own images within your theme, and secondly how to override the images being used by Moodle.&lt;br /&gt;
So first up a bit about images within Moodle,&lt;br /&gt;
&lt;br /&gt;
# Images you want to use within your theme &#039;&#039;&#039;need&#039;&#039;&#039; to be located within your theme&#039;s pix directory.&lt;br /&gt;
# You can use sub directories within the pix directory of your theme.&lt;br /&gt;
# Images used by Moodle&#039;s core are located within the pix directory of Moodle.&lt;br /&gt;
# Modules, blocks and other plugins should also store their images within a pix directory.&lt;br /&gt;
&lt;br /&gt;
So making use of your own images first up. Lets assume you have added two image files to the pix directory of your theme.&lt;br /&gt;
&lt;br /&gt;
* /theme/yourthemename/pix/imageone.jpg&lt;br /&gt;
* /theme/yourthemename/pix/subdir/imagetwo.png&lt;br /&gt;
&lt;br /&gt;
Notice that one image is a JPEG image, and the second is a PNG. Also the second image is in a subdirectory.&lt;br /&gt;
&lt;br /&gt;
The following code snippet illustrates how to make use of your images within your layout file so they can be inserted by your layout template. &lt;br /&gt;
&#039;&#039;theme/yourtheme/layout/somelayout.php&#039;&#039;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
$templatecontext = [&lt;br /&gt;
...&lt;br /&gt;
$imageone =&amp;gt; $OUTPUT-&amp;gt;pix_url(&#039;imageone&#039;, &#039;theme&#039;),&lt;br /&gt;
$imagetwo =&amp;gt; $OUTPUT-&amp;gt;pix_url(&#039;subdir/imagetwo&#039;, &#039;theme&#039;),&lt;br /&gt;
...&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
echo $OUTPUT-&amp;gt;render_from_template(&#039;theme_yourtheme/somelayout&#039;, $templatecontext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use a method of Moodle&#039;s output library to generate the URL to the image. Its not too important how that functions works but it is important that we use it as it is what allows images within Moodle to be over-rideable.&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; include the image file extension. Moodle will work it out automatically and it will not work if you do include it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;theme/yourtheme/templates/somelayout.mustache&#039;&#039;&lt;br /&gt;
&amp;lt;code handlebars&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;img src=&amp;quot;{{{imageone}}}&amp;quot; alt=&amp;quot;Please give your image alt text or set the role to presentation&amp;quot; width=&amp;quot;50&amp;quot; height=&amp;quot;50&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;{{{imagetwo}}}&amp;quot; alt=&amp;quot;Please give your image alt text or set the role to presentation&amp;quot; width=&amp;quot;50&amp;quot; height=&amp;quot;50&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is how you would use the images from within CSS, SCSS or Less as background images.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.divone {&lt;br /&gt;
    background-image: url([[pix:theme|imageone]]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.divtwo {&lt;br /&gt;
    background-image: url([[pix:theme|subdir/imagetwo]]);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If this case we have to use some special notations that Moodle looks for. Whenever Moodle hands out a CSS file it first searches for all &#039;&#039;[[something]]&#039;&#039; tags and replaces them with what is required.&lt;br /&gt;
&lt;br /&gt;
The final thing to notice with both of the cases above is that at no point do we include the images file extension. &lt;br /&gt;
The reason for this leads us into the next topic, how to override images.&lt;br /&gt;
&lt;br /&gt;
From within a theme you can VERY easily override any standard image within Moodle by simply adding the replacement image to the theme&#039;s pix directory in the same sub directory structure as it is in Moodle.&lt;br /&gt;
So for instance we wanted to override the following two images:&lt;br /&gt;
# /pix/moodlelogo.gif&lt;br /&gt;
# /pix/i/user.gif&lt;br /&gt;
We would simply need to add our replacement images to the theme in the following locations&lt;br /&gt;
# /theme/themename/pix_core/moodlelogo.gif&lt;br /&gt;
# /theme/themename/pix_core/i/user.gif&lt;br /&gt;
&#039;&#039;Note that we have created a &#039;&#039;&#039;pix_core&#039;&#039;&#039; directory in our theme. For a specific activity module like chat we need a &#039;&#039;&#039;pix_plugins/mod/chat&#039;&#039;&#039; directory. This directory is &amp;quot;pix_plugins&amp;quot; and then the plugin type (mod) and then the plugin name (chat). &lt;br /&gt;
&lt;br /&gt;
Now the other very cool thing to mention is that Moodle looks for not just replacements of the same image type (jpg, gif, etc...) but also replacements in any image format. This is why above when working with our images we never specified the images file extension.&lt;br /&gt;
This means that the following would also work:&lt;br /&gt;
# /theme/themename/pix_core/moodlelogo.png&lt;br /&gt;
# /theme/themename/pix_core/i/user.bmp&lt;br /&gt;
&lt;br /&gt;
For a more detailed description of how this all works see the page on [[Using images in a theme]].&lt;br /&gt;
&lt;br /&gt;
==Adding custom fonts==&lt;br /&gt;
{{Moodle 2.6}}&lt;br /&gt;
&lt;br /&gt;
CSS3 standard introduced the possibility to specify custom fonts, see [http://www.w3schools.com/css/css3_fonts.asp CSS3 Fonts tutorial].&lt;br /&gt;
&lt;br /&gt;
Since 2.6 Moodle includes support for plugin or theme fonts. It is very similar to theme images and pix subdirectories.&lt;br /&gt;
&lt;br /&gt;
===Font file locations===&lt;br /&gt;
&lt;br /&gt;
Depending on where you intend to use the font put it into one of the following locations:&lt;br /&gt;
* /lib/fonts/ - fonts used in core&lt;br /&gt;
* /plugindir/fonts/ - fonts used by plugin&lt;br /&gt;
* /theme/sometheme/fonts/ - theme specific fonts&lt;br /&gt;
&lt;br /&gt;
You can also override core and plugin fonts in theme:&lt;br /&gt;
* /theme/sometheme/fonts_core/ - overridden core fonts&lt;br /&gt;
* /theme/sometheme/fonts_plugins/plugintype_pluginname/ - overridden fonts of some plugin&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* subdirectories are not allowed&lt;br /&gt;
* use only lowercase alphanumeric characters and underscore in font file names&lt;br /&gt;
* WOFF (Web Open Font Format), TTF (True Type Fonts), OTF (OpenType Fonts), SVG (Scalable Vector Graphic) and EOT (Embedded OpenType) fonts are supported, but for the sake of humanity (And [https://tracker.moodle.org/browse/MDL-15169 MDL_15169] ) please use only WOFF fonts to encourage the quick death of IE8.&lt;br /&gt;
&lt;br /&gt;
===CSS placeholders===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
    font-family: ThreeDumb;&lt;br /&gt;
    src: url([[font:mod_book|3dumb.woff]]);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The placeholder references file /mod/book/fonts/3dumb.woff, the new fontface could be for example used for book headings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
.path-mod-book .book_chapter_title {&lt;br /&gt;
    font-family: ThreeDumb;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If you want to use some font in theme only, you can for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
    font-family: goodDogFont;&lt;br /&gt;
    src: url([[font:theme|good_dog.woff]]);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
a {font-family:goodDogFont;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The font would be stored in /theme/yourtheme/fonts/good_dog.woff file.&lt;br /&gt;
&lt;br /&gt;
===More free fonts===&lt;br /&gt;
&lt;br /&gt;
Please respect all licenses for font redistribution, you can get some nice free fonts from [http://www.fontsquirrel.com http://www.fontsquirrel.com] for example.&lt;br /&gt;
&lt;br /&gt;
===Warning===&lt;br /&gt;
&lt;br /&gt;
This is not intended for forcing of something like Comic Sans on all your visitors...&lt;br /&gt;
&lt;br /&gt;
==Compiling LESS on the fly==&lt;br /&gt;
{{Moodle 2.7}}&lt;br /&gt;
&lt;br /&gt;
You can now provide a LESS file that will be compiled (and cached) on the fly. The purpose of this feature is to dynamically allow the customisation of LESS variables.&lt;br /&gt;
&lt;br /&gt;
===Set up your theme===&lt;br /&gt;
&lt;br /&gt;
# Create a .less file in a less folder. Eg. &amp;lt;code&amp;gt;theme/yourtheme/less/myfile.less&amp;lt;/code&amp;gt;&lt;br /&gt;
# Edit your theme config file, and set $THEME-&amp;gt;&#039;&#039;&#039;lessfile&#039;&#039;&#039; to the name of your file (do not include .less). Eg. &amp;lt;code&amp;gt;$THEME-&amp;gt;lessfile = &#039;myfile&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, the LESS file will be compiled and included in the page on the fly, but that is not very useful yet.&lt;br /&gt;
&lt;br /&gt;
Please note that any file referenced in $THEME-&amp;gt;sheets that shares the same name than the LESS file will be silently ignored.&lt;br /&gt;
&lt;br /&gt;
===Inheriting from a parent===&lt;br /&gt;
&lt;br /&gt;
Even if your theme is inheriting from a parent, the LESS file itself will not inherit from anything, this is something you should do manually. For instance, if you want your LESS file to include all of the LESS code provided by &#039;&#039;theme_bootstrapbase&#039;&#039;, usually to change the variables, you need to manually import the file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
@import &amp;quot;../../bootstrapbase/less/moodle.less&amp;quot;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The path needs to be relative and not absolute. You would definitely want to add that rule first in your file and add anything else below it.&lt;br /&gt;
&lt;br /&gt;
===Programmatically injecting LESS===&lt;br /&gt;
&lt;br /&gt;
There are two theme options to specify a callback function that you need to know about:&lt;br /&gt;
&lt;br /&gt;
# $THEME-&amp;gt;&#039;&#039;&#039;extralesscallback&#039;&#039;&#039;: To return raw LESS code to be injected.&lt;br /&gt;
# $THEME-&amp;gt;&#039;&#039;&#039;lessvariablescallback&#039;&#039;&#039;: To return an array of variables and their values.&lt;br /&gt;
&lt;br /&gt;
Typically you will want to simply inject variables, but if you need to perform more complex manipulations, you can return some raw LESS code. The variables returned by the callback are always injected last.&lt;br /&gt;
&lt;br /&gt;
===Performance===&lt;br /&gt;
&lt;br /&gt;
Compiling LESS on the fly is a slow operation, and even though the result is cached you should be aware of it. If you have enabled the configuration setting &#039;&#039;themedesignermode&#039;&#039; you will definintely notice the slowness as the cache only lives for a very short period of time. Ideally your theme should precompile the LESS into CSS, but if you want to provide theme settings to your user, then using this feature is for you.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
You can refer to the theme &#039;&#039;theme_more&#039;&#039; for an example on how to use this feature.&lt;br /&gt;
&lt;br /&gt;
==Compiling SCSS on the fly==&lt;br /&gt;
{{Moodle 3.2}}&lt;br /&gt;
&lt;br /&gt;
You can now provide a SCSS file that will be compiled (and cached) on the fly. The purpose of this feature is to dynamically allow the customisation of SCSS variables. See the [[SCSS|dedicated page on SCSS]].&lt;br /&gt;
&lt;br /&gt;
==Unobvious Things==&lt;br /&gt;
===Getting Your Theme to Appear Correctly in Theme Selector===&lt;br /&gt;
If you follow the examples on this page to the letter, when you go to the Theme Selector page you may be discouraged to find that your theme does not appear like the other themes do. In fact, instead of your theme&#039;s name, you will see something along the lines of &amp;lt;nowiki&amp;gt;[[pluginname]]&amp;lt;/nowiki&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
To correct this, you must add the theme/THEMENAME/lang/en/theme_THEMENAME.php file, where THEMENAME is the name of the theme folder. Inside that file, add the string &amp;quot;$string[&#039;pluginname&#039;] = &#039;THEMENAME&#039;; &amp;quot;. Make THEMENAME the name of your theme, however you want it displayed in the Theme selector.&lt;br /&gt;
&lt;br /&gt;
Also, make sure to change your config.php file and version.php file to reflect the correct name:&lt;br /&gt;
&lt;br /&gt;
In config.php: $THEME-&amp;gt;name = &#039;NAME&#039;;&lt;br /&gt;
&lt;br /&gt;
In version.php: $plugin-&amp;gt;component = &#039;theme_NAME&#039;; // Full name of the plugin (used for diagnostics)&lt;br /&gt;
&lt;br /&gt;
The screenshot for the theme should be about 500x400 px.&lt;br /&gt;
&lt;br /&gt;
===Required theme divs===&lt;br /&gt;
&lt;br /&gt;
Some parts of Moodle may rely on particular divs, for example the div with id &#039;page-header&#039;.&lt;br /&gt;
&lt;br /&gt;
Consequently all themes must include at least the divs (with the same ids) that are present in the &#039;boost&#039; theme. &lt;br /&gt;
&lt;br /&gt;
Missing out these elements may result in unexpected behaviour within specific modules or other plugins.&lt;br /&gt;
&lt;br /&gt;
==Caching==&lt;br /&gt;
When Moodle is not running in theme designer mode it will look for a cached version of the compiled CSS for the current theme to serve to the browser requesting the page. If the cached file doesn&#039;t yet exist then the CSS will be built and cached during the page request.&lt;br /&gt;
&lt;br /&gt;
The cached CSS is located on disk in Moodle&#039;s local cache:&lt;br /&gt;
  &amp;lt;Moodle data directory &amp;gt;/localcache/theme/&amp;lt;global theme revision&amp;gt;/&amp;lt;theme_name&amp;gt;/css/all_&amp;lt;theme subrevision&amp;gt;.css&lt;br /&gt;
&lt;br /&gt;
The cache path consists of a global theme revision (themerev config value) and a per theme subrevision (themesubrev plugin config value). If either of those are incremented it will change the path to the cache file and cause a new file to be generated.&lt;br /&gt;
&lt;br /&gt;
Individual theme&#039;s CSS cache can be built by using the admin CLI script:&lt;br /&gt;
  php admin/cli/build_theme_css.php --themes boost&lt;br /&gt;
&lt;br /&gt;
The script will only increment the theme subrevision of the theme(s) being built which means existing theme cache&#039;s remain untouched.&lt;br /&gt;
&lt;br /&gt;
==Appendix A==&lt;br /&gt;
=== Theme options ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; id=&amp;quot;theme_options_table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Setting&lt;br /&gt;
! Effect&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;blockrtlmanipulations&#039;&#039;&#039;&lt;br /&gt;
|  Allows the theme to manipulate how the blocks are displayed in a &#039;&#039;right-to-left&#039;&#039; language. Not recommended since we automatically flip CSS for rtl. &lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;csspostprocess&#039;&#039;&#039;&lt;br /&gt;
|  Allows the user to provide the name of a function that all CSS should be passed to before being delivered.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;csstreepostprocessor&#039;&#039;&#039; (Since 3.2)&lt;br /&gt;
|  Allows the user to provide the name of a function that can perform manipulations on an in-memory representation of the CSS tree. Some useful manipulations are available such as the &amp;quot;theme_boost\autoprefixer&amp;quot; which will automatically add vendor prefixes to all CSS that requires them. &lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;doctype&#039;&#039;&#039;&lt;br /&gt;
|  The doctype of the served documents.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;editor_sheets&#039;&#039;&#039;&lt;br /&gt;
|  An array of stylesheets to include just within the body of the TinyMCE text editor. This is required if you want content to resemble its final appearance in the page, while it is being edited in the text editor.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;enablecourseajax&#039;&#039;&#039;&lt;br /&gt;
|  If set to false the course AJAX features will be disabled.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;enable_dock&#039;&#039;&#039;&lt;br /&gt;
|  If set to true the side dock is enabled for blocks.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;prescsscallback&#039;&#039;&#039;&lt;br /&gt;
|  The name of a function that will return some SCSS code to inject at the beginning of the SCSS file specified in $THEME-&amp;gt;scss. (Since 3.2)&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;extrascsscallback&#039;&#039;&#039;&lt;br /&gt;
|  The name of a function that will return some SCSS code to inject at the end of the SCSS file specified in $THEME-&amp;gt;scss. (Since 3.2)&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;extralesscallback&#039;&#039;&#039;&lt;br /&gt;
|  The name of a function that will return some LESS code to inject at the end of the LESS file specified in $THEME-&amp;gt;lessfile. (Since 2.7)&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;hidefromselector&#039;&#039;&#039;&lt;br /&gt;
|  Used to hide a theme from the theme selector (unless theme designer mode is on). Accepts true or false.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;javascripts&#039;&#039;&#039;&lt;br /&gt;
|  An array containing the names of JavaScript files located in /javascript/ to include in the theme. (gets included in the head). This setting should no longer be used - please use AMD [[Javascript Modules]] instead.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;javascripts_footer&#039;&#039;&#039;&lt;br /&gt;
|  As above but will be included in the page footer. This setting should no longer be used - please use AMD [[Javascript Modules]] instead.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;layouts&#039;&#039;&#039;&lt;br /&gt;
|  An array setting the layouts for the theme&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;lessfile&#039;&#039;&#039;&lt;br /&gt;
|  The name of a LESS file in the theme&#039;s less/ folder to compile on the fly. Sheets with the same name will be ignored. (Since 2.7)&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;lessvariablescallback&#039;&#039;&#039;&lt;br /&gt;
|  The name of a function that will modify some LESS variables before compiling the LESS file specified in $THEME-&amp;gt;lessfile. (Since 2.7)&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;scss&#039;&#039;&#039;&lt;br /&gt;
|  The name of a SCSS file in the theme&#039;s scss/ folder to compile on the fly. Sheets with the same name will be ignored. This can also be a function which returns SCSS, in which case all import paths will be relative to the scss folder in this theme or any of it&#039;s parents. (Since 3.2)&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;name&#039;&#039;&#039;&lt;br /&gt;
|  Name of the theme. Most likely the name of the directory in which this file resides.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;parents&#039;&#039;&#039;&lt;br /&gt;
|  An array of themes to inherit from. If the theme you inherit from inherits from a parent as well, you need to indicate the grand parent here too.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;parents_exclude_javascripts&#039;&#039;&#039;&lt;br /&gt;
|  An array of JavaScript files NOT to inherit from the themes parents&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;parents_exclude_sheets&#039;&#039;&#039;&lt;br /&gt;
|  An array of stylesheets not to inherit from the themes parents&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;plugins_exclude_sheets&#039;&#039;&#039;&lt;br /&gt;
|  An array of plugin sheets to ignore and not include.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;renderfactory&#039;&#039;&#039;&lt;br /&gt;
|  Sets a custom render factory to use with the theme, used when working with custom renderers. You most likely want this set to &amp;quot;theme_overridden_renderer_factory&amp;quot;. &lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;sheets&#039;&#039;&#039;&lt;br /&gt;
|  An array of stylesheets to include for this theme. Should be located in the theme&#039;s style directory. Not required if using less or scss.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;yuicssmodules&#039;&#039;&#039;&lt;br /&gt;
|  An array of YUI CSS modules to be included. This setting should probably be set to &#039;&#039; to prevent and YUI CSS being included. &lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;undeletableblocktypes&#039;&#039;&#039;&lt;br /&gt;
|  An array of Block types that must exist on all pages in this theme or this theme will be unusable. If a block type listed here is missing when a page is loaded - it will be auto-created (but only shown for themes that require it).&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;addblockposition&#039;&#039;&#039;&lt;br /&gt;
|  Either BLOCK_ADDBLOCK_POSITION_FLATNAV, BLOCK_ADDBLOCK_POSITION_DEFAULT or BLOCK_ADDBLOCK_POSITION_CUSTOM. Defines where to put the &amp;quot;Add a block&amp;quot; controls when editing is enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===The different layouts as of 21st April 2013===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; id=&amp;quot;theme_layouts_table&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Layout&lt;br /&gt;
! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| base&lt;br /&gt;
| Most backwards compatible layout without the blocks - this is the layout used by default.&lt;br /&gt;
|- &lt;br /&gt;
| standard&lt;br /&gt;
| Standard layout with blocks, this is recommended for most pages with general information.&lt;br /&gt;
|- &lt;br /&gt;
| course&lt;br /&gt;
| Main course page.&lt;br /&gt;
|- &lt;br /&gt;
| coursecategory&lt;br /&gt;
| Use for browsing through course categories.&lt;br /&gt;
|- &lt;br /&gt;
| incourse&lt;br /&gt;
| Default layout while browsing a course, typical for modules.&lt;br /&gt;
|- &lt;br /&gt;
| frontpage&lt;br /&gt;
| The site home page.&lt;br /&gt;
|- &lt;br /&gt;
| admin&lt;br /&gt;
| Administration pages and scripts.&lt;br /&gt;
|- &lt;br /&gt;
| mydashboard&lt;br /&gt;
| My dashboard page.&lt;br /&gt;
|- &lt;br /&gt;
| mypublic&lt;br /&gt;
| My public page.&lt;br /&gt;
|- &lt;br /&gt;
| login&lt;br /&gt;
| The login page.&lt;br /&gt;
|-&lt;br /&gt;
| popup&lt;br /&gt;
| Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
|-&lt;br /&gt;
| frametop&lt;br /&gt;
| Used for legacy frame layouts only. No blocks and minimal footer.&lt;br /&gt;
|-&lt;br /&gt;
| embedded&lt;br /&gt;
| Used for embedded pages, like iframe/object embedded in moodleform - it needs as much space as possible&lt;br /&gt;
|-&lt;br /&gt;
| maintenance&lt;br /&gt;
| Used during upgrade and install. This must not have any blocks, and it is a good idea if it does not have links to other places - for example there should not be a home link in the footer.&lt;br /&gt;
|-&lt;br /&gt;
| print&lt;br /&gt;
| Used when the page is being displayed specifically for printing.&lt;br /&gt;
|-&lt;br /&gt;
| redirect&lt;br /&gt;
| Used when a redirection is occurring&lt;br /&gt;
|-&lt;br /&gt;
| report&lt;br /&gt;
| Used for reports.&lt;br /&gt;
|-&lt;br /&gt;
| secure&lt;br /&gt;
| Used for safebrowser and securewindow.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* MoodleBites Theme Design - completely online courses [https://www.moodlebites.com/mod/page/view.php?id=3208 Level 1] and [https://www.moodlebites.com/mod/page/view.php?id=3210 Level 2] are designed to assist Moodle administrators, designers, and developers get up-to-speed with Moodle Theme design, and are run by [https://www.hrdnz.com HRDNZ] (Certified Moodle Partner since 2006).&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Tutorial&amp;diff=55547</id>
		<title>Tutorial</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Tutorial&amp;diff=55547"/>
		<updated>2019-02-05T03:08:22Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to Moodle development!&lt;br /&gt;
&lt;br /&gt;
This is a tutorial to help you learn how to write plugins for Moodle from start to finish, while showing you how to navigate the most important developer documentation along the way.&lt;br /&gt;
&lt;br /&gt;
PRE-REQUISITES:  We assume you are fairly comfortable with [[PHP FAQ|PHP]] in general and that you are able to [[:en:Installing AMP|install a database and web server]] on your local machine. &lt;br /&gt;
&lt;br /&gt;
If you need to learn PHP, you can see one PHP tutorial at http://www.w3schools.com/php/default.asp, another at http://php.net/manual/en/tutorial.php and several videos in YouTube at https://www.youtube.com/results?search_query=learn+php. &lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
===What&#039;s in the box===&lt;br /&gt;
If you [http://download.moodle.org/ download] Moodle source code or clone it from [https://github.com/moodle/moodle git], you will see a bunch of files and folders. This code consists of [[Core_APIs|Moodle core]] (that consists of the Very core and Core components), [[Moodle_libraries_credits|third party libraries]] and [[Plugin_types|plugins]]. Their mixed locations can be quite confusing at first but as you start working with it it will become more clear. Moodle developers should avoid modifications of the third party libraries (unless required) and core can never call methods defined in plugins. See also [[Communication Between Components]]&lt;br /&gt;
&lt;br /&gt;
===Setting up your development environment===&lt;br /&gt;
* [[Setting up development environment]]: PHP server, database...&lt;br /&gt;
* Moodle uses Git for development. View the following link for basic information about Git and Moodle: [[Git for developers]]&lt;br /&gt;
&lt;br /&gt;
===The Moodle development framework===&lt;br /&gt;
===What type of plugin are you developing?===&lt;br /&gt;
* Moodle has lots of different types of plugins.&lt;br /&gt;
* There are 24 different categories of plugin listed on the moodle plugin database. Before starting check here to see if someone else has not already created what you are looking for. Perhaps you could contribute to their plugin instead of creating a new one.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* https://moodle.org/plugins/&lt;br /&gt;
* [[Plugin types]]&lt;br /&gt;
&lt;br /&gt;
==Let&#039;s make a plugin==&lt;br /&gt;
===The skeleton of your plugin===&lt;br /&gt;
&lt;br /&gt;
The code of a plugin is organised into multiple different files and directories within a single root directory. All plugins follow the same directory and file structure.&lt;br /&gt;
&lt;br /&gt;
Links&lt;br /&gt;
&lt;br /&gt;
* [[Plugin files]] - Provides a list of required and common plugins files along with their location and purpose.&lt;br /&gt;
&lt;br /&gt;
===Basic page structure===&lt;br /&gt;
&lt;br /&gt;
The link below explains how to create and display a simple page in Moodle.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Page API]]&lt;br /&gt;
&lt;br /&gt;
===Multiple languages support===&lt;br /&gt;
Moodle has a mechanism for displaying given text string in multiple languages, depending on the user&#039;s preferred language and the site configuration. Plugin authors must define all the text strings used by the plugin in the default English language. That is then used as a reference for translations to other languages.&lt;br /&gt;
&lt;br /&gt;
* [[String API]]&lt;br /&gt;
&lt;br /&gt;
===Moodle file structure===&lt;br /&gt;
==== Automatic Class Loading ====&lt;br /&gt;
Automatic class loading helps us to automatically include class files as and when they are required instead of manually including them everytime. Moodle supports automatic class loading. See the link below for the explanation of rules associated with it - &lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
[[ Automatic class loading]]&lt;br /&gt;
&lt;br /&gt;
==== Callbacks ====&lt;br /&gt;
You can add a lot of features to your plugin by providing certain callbacks that Moodle expects to be present in your plugin&#039;s lib.php file. A detailed list can be found at - &lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
[[ Callbacks ]]&lt;br /&gt;
&lt;br /&gt;
==== Plugin types ====&lt;br /&gt;
Moodle supports a wide range of plugin types. The complete list and location to place these plugins can be found at - &lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
[[ Plugin types ]]&lt;br /&gt;
&lt;br /&gt;
==== Core APIs ====&lt;br /&gt;
Moodle provides apis for a plugin to interact with core and other external systems. For example you don&#039;t have to manually do any SQL queries, Moodle provides it&#039;s own DDL and DML layers. The link below lists all major core apis in Moodle - &lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
[[ Core APIs ]]&lt;br /&gt;
&lt;br /&gt;
==== Browser accessible pages ====&lt;br /&gt;
Any php file in your plugin will either be browser accessible or be an internal file. &lt;br /&gt;
&lt;br /&gt;
For browser accessible pages you must include config.php with code something similar to this - &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
require_once(&#039;../../config.php&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For internal files the code should use the following - &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
defined(&#039;MOODLE_INTERNAL&#039;) || die();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add basic content to your page===&lt;br /&gt;
* Content for a page is added through renderers.&lt;br /&gt;
* Renderers are typically stored in the &amp;quot;classes/output&amp;quot; directory.&lt;br /&gt;
* Putting content in renderers allows themers to override the visual display of the content.&lt;br /&gt;
* Very basic information is presented using the html_writer class.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Renderer]]&lt;br /&gt;
&lt;br /&gt;
=== Content with templates ===&lt;br /&gt;
* In most cases when displaying content, templates should be used.&lt;br /&gt;
* templates are stored in the &amp;quot;templates&amp;quot; directory. The templates use mustache files.&lt;br /&gt;
* Mustache files allow for more generic html with placeholders inserted, that inserts the data (context) at run time.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Templates]]&lt;br /&gt;
&lt;br /&gt;
===Adding your plugin into Moodle&#039;s navigation===&lt;br /&gt;
* The moodle navigation system has hooks which allows plugins to add links to the navigation menu.&lt;br /&gt;
* Hooks are located in lib.php. Try to keep lib.php as small as possible as this file is included on every page. Put classes and functions elsewhere.&lt;br /&gt;
* Course navigation extension example:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function tool_devcourse_extend_navigation_course($navigation, $course, $coursecontext) {&lt;br /&gt;
    $url = new moodle_url(&#039;/admin/tool/devcourse/index.php&#039;);&lt;br /&gt;
    $devcoursenode = navigation_node::create(&#039;Development course&#039;, $url, navigation_node::TYPE_CUSTOM, &#039;Dev course&#039;, &#039;devcourse&#039;);&lt;br /&gt;
    $navigation-&amp;gt;add_node($devcoursenode);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Navigation API]]&lt;br /&gt;
* [[:en:Navigation]]&lt;br /&gt;
&lt;br /&gt;
===Database queries===&lt;br /&gt;
* Moodle has a generic database query library. Behind this library are additional libraries which allow Moodle to work with MySQL, PostgreSQL, Oracle, SQL Server, and Maria DB.&lt;br /&gt;
* Where possible it is advisable to use the predefined functions rather than write out SQL. Writing SQL has a greater chance of not working with one of the supported databases.&lt;br /&gt;
* The return of the select functions tends to be an object or an array of objects.&lt;br /&gt;
&lt;br /&gt;
Example call to retrieve data from the course table.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
global $DB;&lt;br /&gt;
$courses = $DB-&amp;gt;get_records(&#039;course&#039;, null, &#039;&#039;, &#039;id, category, fullname, shortname&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Example of data returned from the above code.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
    [43] =&amp;gt; stdClass Object&lt;br /&gt;
        (&lt;br /&gt;
            [id] =&amp;gt; 43&lt;br /&gt;
            [category] =&amp;gt; 1&lt;br /&gt;
            [fullname] =&amp;gt; XX -Test 5&lt;br /&gt;
            [shortname] =&amp;gt; xxt5&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
    [5] =&amp;gt; stdClass Object&lt;br /&gt;
        (&lt;br /&gt;
            [id] =&amp;gt; 5&lt;br /&gt;
            [category] =&amp;gt; 1&lt;br /&gt;
            [fullname] =&amp;gt; With the glossary&lt;br /&gt;
            [shortname] =&amp;gt; wtg&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
    [39] =&amp;gt; stdClass Object&lt;br /&gt;
        (&lt;br /&gt;
            [id] =&amp;gt; 39&lt;br /&gt;
            [category] =&amp;gt; 1&lt;br /&gt;
            [fullname] =&amp;gt; XX - Test 1&lt;br /&gt;
            [shortname] =&amp;gt; xxt1&lt;br /&gt;
        )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Database]]&lt;br /&gt;
* [[Data manipulation API]]&lt;br /&gt;
&lt;br /&gt;
===Creating your own database tables===&lt;br /&gt;
* We create our database tables in Moodle using the  XMLDB editor. This is located in the administration block &amp;quot;Site administration | Development | XMLDB editor&amp;quot;.&lt;br /&gt;
* The {plugin}\db directory needs to have write access for the XMLDB editor to be most effective.&lt;br /&gt;
* XMLDB editor creates an install.xml file in the db directory. This file will be loaded during the install to create your tables.&lt;br /&gt;
* XMLDB editor will produce php update code for adding and updating moodle database tables.&lt;br /&gt;
&lt;br /&gt;
The XMLDB main page.&lt;br /&gt;
&lt;br /&gt;
[[{{ns:file}}:xmldb-main.png]]&lt;br /&gt;
&lt;br /&gt;
Upgrade code generated by the XMLDB&lt;br /&gt;
&lt;br /&gt;
[[{{ns:file}}:xmldb-upgrade-code.png]]&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
* [[XMLDB editor]]&lt;br /&gt;
* [[Using XMLDB]]&lt;br /&gt;
* [[XMLDB Documentation]]&lt;br /&gt;
* [[Upgrade API]]&lt;br /&gt;
* [[XMLDB introduction]]&lt;br /&gt;
&lt;br /&gt;
===Supporting access permissions: roles, capabilities and contexts===&lt;br /&gt;
* Capabilities are controlled in &amp;quot;access.php&amp;quot; under the &amp;quot;db&amp;quot; directory.&lt;br /&gt;
* This file has an array of capabilities with the following:&lt;br /&gt;
** name&lt;br /&gt;
** possible security risks behind giving this capability.&lt;br /&gt;
** The context that this capability works in.&lt;br /&gt;
** The default roles (teacher, manager, student, etc) that have this capability.&lt;br /&gt;
** Various other information.&lt;br /&gt;
* These capabilities are checked in code to allow access to pages, sections, and abilities (saving, deleting, etc).&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
* [[Access API]]&lt;br /&gt;
* [[Roles#Context]]&lt;br /&gt;
* [[:en:Category:Capabilities]]&lt;br /&gt;
* [[:en:Roles and permissions]]&lt;br /&gt;
&lt;br /&gt;
===Adding web forms===&lt;br /&gt;
* Moodle has it&#039;s own forms library.&lt;br /&gt;
* The forms lib includes a lot of accessibility code, and error checking, by default.&lt;br /&gt;
* Moodle forms can be displayed in JavaScript using &#039;fragments&#039;.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Form API]]&lt;br /&gt;
* [[lib/formslib.php Form Definition]]&lt;br /&gt;
* [[Fragment]]&lt;br /&gt;
&lt;br /&gt;
===Maintaining good security===&lt;br /&gt;
* Use the sesskey when directing to pages to do actions.&lt;br /&gt;
* Use the appropriate filters when retrieving parameters&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Security]]&lt;br /&gt;
* [[lib/formslib.php Form Definition#Most Commonly Used PARAM .2A Types]]&lt;br /&gt;
* [[Output functions#p.28.29 and s.28.29]]&lt;br /&gt;
&lt;br /&gt;
===Handling files===&lt;br /&gt;
* Files are conceptually stored in file areas.&lt;br /&gt;
* Plugins can only access files from it&#039;s own component.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[File API]]&lt;br /&gt;
* [[File API internals]]&lt;br /&gt;
* [[Using the File API in Moodle forms]]&lt;br /&gt;
&lt;br /&gt;
===Adding Javascript===&lt;br /&gt;
* Moodle is currently using jquery and AMD (Asynchronous Module Definition).&lt;br /&gt;
* JavaScript files are located in the &amp;quot;amd/src&amp;quot; directory.&lt;br /&gt;
* Use grunt to build your JavaScript.&lt;br /&gt;
* Include your JavaScript in php files as follows:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$this-&amp;gt;page-&amp;gt;requires-&amp;gt;js_call_amd(&#039;{JScriptfilename}&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Can also be included in mustache templates.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Javascript Modules]]&lt;br /&gt;
* [[jQuery]]&lt;br /&gt;
* [[Javascript FAQ]]&lt;br /&gt;
* [[JavaScript guidelines]]&lt;br /&gt;
* [[Grunt]]&lt;br /&gt;
&lt;br /&gt;
===Adding events and logging===&lt;br /&gt;
* All logging in moodle is done through the events system.&lt;br /&gt;
* New events should be located in the &amp;quot;classes/event&amp;quot; directory.&lt;br /&gt;
* It is possible to create observers and subscribe to events.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Event 2]]&lt;br /&gt;
* [[Logging 2]]&lt;br /&gt;
&lt;br /&gt;
===Accessibility===&lt;br /&gt;
&lt;br /&gt;
Accessibility is an important consideration while developing a plugin to make sure your plugin is accessible to all users and doesn&#039;t discriminate against users with disablities. This often is a mandated requirement in many countries. The links below explain common practices that we follow at Moodle to make the interface more accessible.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
* [[Accessibility]]&lt;br /&gt;
* [[Usability]]&lt;br /&gt;
===Web Services and AJAX===&lt;br /&gt;
* Moodle web services uses the external functions API.&lt;br /&gt;
* The recommended way to make AJAX requests is to use the ajax AMD file which uses the external functions API.&lt;br /&gt;
* External functions should be located in the &amp;quot;classes/external.php&amp;quot; file.&lt;br /&gt;
* A list of services should be included in &amp;quot;db/services.php&amp;quot;. This file is required to register the web services with Moodle.&lt;br /&gt;
* The services list is an array which contains:&lt;br /&gt;
** &#039;&#039;&#039;classname&#039;&#039;&#039; Name of the external class.&lt;br /&gt;
** &#039;&#039;&#039;methodname&#039;&#039;&#039; The name of the external function.&lt;br /&gt;
** &#039;&#039;&#039;classpath&#039;&#039;&#039; system path to the external function file.&lt;br /&gt;
** &#039;&#039;&#039;description&#039;&#039;&#039; Description of the function&lt;br /&gt;
** &#039;&#039;&#039;type&#039;&#039;&#039; Create, read, update, delete&lt;br /&gt;
** &#039;&#039;&#039;ajax&#039;&#039;&#039; Can this function be used with ajax?&lt;br /&gt;
** &#039;&#039;&#039;capabilities&#039;&#039;&#039; Capabilities required to use this function.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[External functions API]]&lt;br /&gt;
* [[Adding a web service to a plugin]]&lt;br /&gt;
* [[Web services API]]&lt;br /&gt;
&lt;br /&gt;
===Using caching to improve performance===&lt;br /&gt;
* The main cache used by moodle is the Moodle Universal Cache (MUC).&lt;br /&gt;
* The MUC has several cache definitions - &lt;br /&gt;
** Request cache&lt;br /&gt;
** Session cache&lt;br /&gt;
** Application&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[The Moodle Universal Cache (MUC)]]&lt;br /&gt;
* [[:en:MUC FAQ]]&lt;br /&gt;
* [[:en:Caching]]&lt;br /&gt;
&lt;br /&gt;
===Supporting backup and restore===&lt;br /&gt;
* Supporting backup and restore requires creating several files in the &#039;backup/moodle2&#039; directory.&lt;br /&gt;
* Back requires a class to extend the backup_task of some sort. There may be a specific plugin task to extend.&lt;br /&gt;
* Restore requires a class to extend the restore_task of some sort. There may be a specific plugin task to extend.&lt;br /&gt;
* The restore steps lib defines the structure of the plugin to be restored.&lt;br /&gt;
* The backup steps lib defines steps, settings, attributes, etc.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Backup 2.0 for developers]] - provides an example of step-by-step implementation of backup support to your plugin&lt;br /&gt;
* [[:en:Backup and restore FAQ]]&lt;br /&gt;
&lt;br /&gt;
===Supporting automated testing===&lt;br /&gt;
* Moodle has two types of automated testing: php unit tests, and behat tests.&lt;br /&gt;
* Unit tests are for testing functions.&lt;br /&gt;
* Behat tests runs through scenarios.&lt;br /&gt;
** Behat tests follows a script and navigates through moodle pages.&lt;br /&gt;
* unit tests should be located in the &amp;quot;tests&amp;quot; directory.&lt;br /&gt;
* behat tests should be located in the &amp;quot;tests/behat&amp;quot; directory.&lt;br /&gt;
* Tests located in these directories will be run through when a full test run is initiated.&lt;br /&gt;
* behat tests are actually feature files and end with the extension &amp;quot;.feature&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
links&lt;br /&gt;
&lt;br /&gt;
* [[Writing PHPUnit tests]]&lt;br /&gt;
* [[PHPUnit]]&lt;br /&gt;
* [[Acceptance testing]]&lt;br /&gt;
* [[Behat integration]]&lt;br /&gt;
&lt;br /&gt;
==Publishing your plugin==&lt;br /&gt;
===Adding your plugin to moodle.org===&lt;br /&gt;
* publish your plugins at https://moodle.org/plugins/&lt;br /&gt;
* Publishing plugins on the moodle site leads you through a bunch of steps that need to be completed in order for the plugin to be approved and published.&lt;br /&gt;
* Plugins will be run through a pre-checker to give suggestions about possible issues with the code.&lt;br /&gt;
&lt;br /&gt;
===Supporting your plugin===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TODO==&lt;br /&gt;
Finishing this tutorial:&lt;br /&gt;
# About one or two screens for each section with a very generic overview for beginners, containing links to relevant docs WITH COMMENTS ABOUT QUALITY, USEFULNESS, CAVEATS etc.&lt;br /&gt;
# Go through all the linked pages and make sure they are current and accurate.&lt;br /&gt;
# Add a worked example to this page, so that each section has suggestions about things to add to the admin tool being built as an exercise.  If the code is long, it could be placed on separate pages.  A good reference for style is [[Mobile_support_for_plugins]] and [[Blocks]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* See [https://moodle.org/mod/forum/discuss.php?d=355789 this (july 2017) forum thread ] about Getting Started with Moodle Development.&lt;br /&gt;
* See [https://moodle.org/mod/forum/discuss.php?d=352360 this (may 2017) forum thread] about Getting Started with Moodle Development.&lt;br /&gt;
* MoodleBites for Developers - completely online courses [https://www.moodlebites.com/mod/page/view.php?id=24546 Level 1] and [https://www.moodlebites.com/mod/page/view.php?id=19542 Level 2] are designed to get new developers up-to-speed with Moodle development, and are run online by HRDNZ (Certified Moodle Partner since 2006).&lt;br /&gt;
&lt;br /&gt;
See also these older tutorials:&lt;br /&gt;
&lt;br /&gt;
* [[Blocks|A Step-by-step Guide To Creating Blocks]] &lt;br /&gt;
* [[NEWMODULE Tutorial]]&lt;br /&gt;
* [[Mobile_support_for_plugins|Moodle Mobile plugin tutorial]]&lt;br /&gt;
* [[Category:Tutorial|Other tutorials in these docs]]&lt;br /&gt;
&lt;br /&gt;
==Any questions?==&lt;br /&gt;
&lt;br /&gt;
If you have any questions, you&#039;re welcome to post in the [https://moodle.org/mod/forum/view.php?id=55 General developer forum] on moodle.org&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Developer_FAQ&amp;diff=55546</id>
		<title>Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Developer_FAQ&amp;diff=55546"/>
		<updated>2019-02-05T03:04:25Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: /* Where can I start? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Help for new coders==&lt;br /&gt;
&lt;br /&gt;
===Where can I start?===&lt;br /&gt;
&lt;br /&gt;
* [[Finding your way into the Moodle code]]&lt;br /&gt;
* [http://dev.moodle.org/ Moodle Developer Courses]&lt;br /&gt;
* MoodleBites for Developers online courses [https://www.moodlebites.com/mod/page/view.php?id=24546 Level 1] and [https://www.moodlebites.com/mod/page/view.php?id=19542 Level 2]&lt;br /&gt;
&lt;br /&gt;
===Where can &amp;quot;newbies&amp;quot; to Moodle get help?===&lt;br /&gt;
&lt;br /&gt;
The [http://moodle.org/mod/forum/view.php?f=33 General developer forum]! Feel free to ask any question, no matter how basic or advanced. Many people ask different levels of question every day, and the community is generally welcoming and quick to respond.&lt;br /&gt;
&lt;br /&gt;
===How do I create a patch?===&lt;br /&gt;
&lt;br /&gt;
See [[How to create a patch]].&lt;br /&gt;
&lt;br /&gt;
=== How do I create a new module or plugin? ===&lt;br /&gt;
&lt;br /&gt;
See&lt;br /&gt;
* [[NEWMODULE Documentation]] &lt;br /&gt;
* [[Blocks]] &lt;br /&gt;
* [[Authentication plugins]]&lt;br /&gt;
* [[Developer_documentation#Make_a_new_plugin|full list of plugin types]].&lt;br /&gt;
* Also have a look at the [http://dev.moodle.org/ Moodle Developer Courses].&lt;br /&gt;
&lt;br /&gt;
; Book&lt;br /&gt;
: [https://www.packtpub.com/moodle-1-9-extension-development/book Moodle 1.9 Extension Development - Customize and extend Moodle using its robust plug-in systems] by Jonathan Moore, Michael Churchward - highly recommended&lt;br /&gt;
&lt;br /&gt;
===Is there any information on backup and restore?===&lt;br /&gt;
&lt;br /&gt;
See [[Backup]].&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t use one of the available plug-in points to make my change. What alternative is there?==&lt;br /&gt;
&lt;br /&gt;
See [[Local customisation]].&lt;br /&gt;
&lt;br /&gt;
==Moodle&#039;s database==&lt;br /&gt;
&lt;br /&gt;
===Where can I see a schema for the structure of the Moodle database?===&lt;br /&gt;
&lt;br /&gt;
[[Database_schema_introduction]] gives a high level overview of the database schema.&lt;br /&gt;
&lt;br /&gt;
Because of Moodle&#039;s modular nature, there is no single, detailed representation of the full database schema. Instead, the tables for each part of Moodle are defined in a database-neutral XML format, see [[Database_FAQ#XMLDB| XMLDB]], in each part of Moodle. Look for files called install.xml in folders called db throughout the code. Alternatively, from Moodle 2.0 onwards, go to Administration -&amp;gt; Development -&amp;gt; XMLDB editor, and use the [Doc] links to see automatically generated documentation built form the comments in the install.xml files.&lt;br /&gt;
&lt;br /&gt;
See also [[Database FAQ]].&lt;br /&gt;
&lt;br /&gt;
==How to get/set information when writing new Moodle code==&lt;br /&gt;
&lt;br /&gt;
===How do I find out the currently-logged-on user?===&lt;br /&gt;
&lt;br /&gt;
The global object $USER, which contains the numeric $USER-&amp;gt;id among other things.&lt;br /&gt;
&lt;br /&gt;
===How do I find out the current course?===&lt;br /&gt;
The global object $COURSE, which contains the numeric $COURSE-&amp;gt;id&lt;br /&gt;
&lt;br /&gt;
===How do I insert/retrieve records in the database, without creating my own database connections?===&lt;br /&gt;
&lt;br /&gt;
You use the $DB object, as described in the [[Data manipulation API]] documentation.&lt;br /&gt;
&lt;br /&gt;
===How do I get/set configuration settings?===&lt;br /&gt;
&lt;br /&gt;
;config table&lt;br /&gt;
To get config values you would typically access the global $CFG object directly, which is automatically created by the core Moodle scripts. To set these &amp;quot;main&amp;quot; config values use &#039;&#039;set_config($name, $value)&#039;&#039;. The values are stored in the Moodle &amp;quot;config&amp;quot; database table, but these functions take care of cacheing on your behalf, so you should always use these rather than fetching the records directly.&lt;br /&gt;
&lt;br /&gt;
;config_plugin table&lt;br /&gt;
There is also a second table of config settings specifically for plugins (&amp;quot;config_plugin&amp;quot;). These are not automatically loaded into the $CFG object, so to fetch these you would use get_config($plugin, $name). To set them use set_config($name, $value, $plugin).&lt;br /&gt;
&lt;br /&gt;
On top of those global configuration values, individual blocks may also have configuration &amp;quot;object&amp;quot; associated with it (the data is serialized and stored in the &amp;quot;block_instance&amp;quot; table). Within blocks, this data is automatically loaded into the &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; attribute of the block.&lt;br /&gt;
&lt;br /&gt;
==What is &#039;HEAD&#039;?==&lt;br /&gt;
&lt;br /&gt;
HEAD is version control jargon for the latest version, so at the moment it means Moodle 2.0 dev version. (After the Moodle 2.0 stable branch is made, HEAD will mean 2.1 dev). Look for example, at the links at the top of http://cvs.moodle.org/moodle/README.txt?view=log&amp;amp;pathrev=MOODLE_19_STABLE You can get it from http://download.moodle.org/ and install it if you want to play.&lt;br /&gt;
&lt;br /&gt;
== How do I migrate code to Moodle 2.0? ==&lt;br /&gt;
* See [[Migrating contrib code to 2.0]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Contributed code FAQ]]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/view.php?f=33 General developer forum]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=55719 How does date / time in DB convert to real Date / Time?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=158521 Why git?]&lt;br /&gt;
&lt;br /&gt;
==Learn more==&lt;br /&gt;
&lt;br /&gt;
*Two online courses specifically for Moodle developers [https://www.moodlebites.com/mod/page/view.php?id=24546 Level 1] and [https://www.moodlebites.com/mod/page/view.php?id=19542 Level 2] are run by [http://www.hrdnz.com HRDNZ] (certified Moodle Partner since 2006) specifically helping new Moodle developers get up-to-speed with Moodle development. &lt;br /&gt;
&lt;br /&gt;
[[Category: FAQ]]&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Developer_FAQ&amp;diff=55545</id>
		<title>Developer FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Developer_FAQ&amp;diff=55545"/>
		<updated>2019-02-05T03:00:50Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Help for new coders==&lt;br /&gt;
&lt;br /&gt;
===Where can I start?===&lt;br /&gt;
&lt;br /&gt;
* [[Finding your way into the Moodle code]]&lt;br /&gt;
* [http://dev.moodle.org/ Moodle Developer Courses]&lt;br /&gt;
&lt;br /&gt;
===Where can &amp;quot;newbies&amp;quot; to Moodle get help?===&lt;br /&gt;
&lt;br /&gt;
The [http://moodle.org/mod/forum/view.php?f=33 General developer forum]! Feel free to ask any question, no matter how basic or advanced. Many people ask different levels of question every day, and the community is generally welcoming and quick to respond.&lt;br /&gt;
&lt;br /&gt;
===How do I create a patch?===&lt;br /&gt;
&lt;br /&gt;
See [[How to create a patch]].&lt;br /&gt;
&lt;br /&gt;
=== How do I create a new module or plugin? ===&lt;br /&gt;
&lt;br /&gt;
See&lt;br /&gt;
* [[NEWMODULE Documentation]] &lt;br /&gt;
* [[Blocks]] &lt;br /&gt;
* [[Authentication plugins]]&lt;br /&gt;
* [[Developer_documentation#Make_a_new_plugin|full list of plugin types]].&lt;br /&gt;
* Also have a look at the [http://dev.moodle.org/ Moodle Developer Courses].&lt;br /&gt;
&lt;br /&gt;
; Book&lt;br /&gt;
: [https://www.packtpub.com/moodle-1-9-extension-development/book Moodle 1.9 Extension Development - Customize and extend Moodle using its robust plug-in systems] by Jonathan Moore, Michael Churchward - highly recommended&lt;br /&gt;
&lt;br /&gt;
===Is there any information on backup and restore?===&lt;br /&gt;
&lt;br /&gt;
See [[Backup]].&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t use one of the available plug-in points to make my change. What alternative is there?==&lt;br /&gt;
&lt;br /&gt;
See [[Local customisation]].&lt;br /&gt;
&lt;br /&gt;
==Moodle&#039;s database==&lt;br /&gt;
&lt;br /&gt;
===Where can I see a schema for the structure of the Moodle database?===&lt;br /&gt;
&lt;br /&gt;
[[Database_schema_introduction]] gives a high level overview of the database schema.&lt;br /&gt;
&lt;br /&gt;
Because of Moodle&#039;s modular nature, there is no single, detailed representation of the full database schema. Instead, the tables for each part of Moodle are defined in a database-neutral XML format, see [[Database_FAQ#XMLDB| XMLDB]], in each part of Moodle. Look for files called install.xml in folders called db throughout the code. Alternatively, from Moodle 2.0 onwards, go to Administration -&amp;gt; Development -&amp;gt; XMLDB editor, and use the [Doc] links to see automatically generated documentation built form the comments in the install.xml files.&lt;br /&gt;
&lt;br /&gt;
See also [[Database FAQ]].&lt;br /&gt;
&lt;br /&gt;
==How to get/set information when writing new Moodle code==&lt;br /&gt;
&lt;br /&gt;
===How do I find out the currently-logged-on user?===&lt;br /&gt;
&lt;br /&gt;
The global object $USER, which contains the numeric $USER-&amp;gt;id among other things.&lt;br /&gt;
&lt;br /&gt;
===How do I find out the current course?===&lt;br /&gt;
The global object $COURSE, which contains the numeric $COURSE-&amp;gt;id&lt;br /&gt;
&lt;br /&gt;
===How do I insert/retrieve records in the database, without creating my own database connections?===&lt;br /&gt;
&lt;br /&gt;
You use the $DB object, as described in the [[Data manipulation API]] documentation.&lt;br /&gt;
&lt;br /&gt;
===How do I get/set configuration settings?===&lt;br /&gt;
&lt;br /&gt;
;config table&lt;br /&gt;
To get config values you would typically access the global $CFG object directly, which is automatically created by the core Moodle scripts. To set these &amp;quot;main&amp;quot; config values use &#039;&#039;set_config($name, $value)&#039;&#039;. The values are stored in the Moodle &amp;quot;config&amp;quot; database table, but these functions take care of cacheing on your behalf, so you should always use these rather than fetching the records directly.&lt;br /&gt;
&lt;br /&gt;
;config_plugin table&lt;br /&gt;
There is also a second table of config settings specifically for plugins (&amp;quot;config_plugin&amp;quot;). These are not automatically loaded into the $CFG object, so to fetch these you would use get_config($plugin, $name). To set them use set_config($name, $value, $plugin).&lt;br /&gt;
&lt;br /&gt;
On top of those global configuration values, individual blocks may also have configuration &amp;quot;object&amp;quot; associated with it (the data is serialized and stored in the &amp;quot;block_instance&amp;quot; table). Within blocks, this data is automatically loaded into the &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; attribute of the block.&lt;br /&gt;
&lt;br /&gt;
==What is &#039;HEAD&#039;?==&lt;br /&gt;
&lt;br /&gt;
HEAD is version control jargon for the latest version, so at the moment it means Moodle 2.0 dev version. (After the Moodle 2.0 stable branch is made, HEAD will mean 2.1 dev). Look for example, at the links at the top of http://cvs.moodle.org/moodle/README.txt?view=log&amp;amp;pathrev=MOODLE_19_STABLE You can get it from http://download.moodle.org/ and install it if you want to play.&lt;br /&gt;
&lt;br /&gt;
== How do I migrate code to Moodle 2.0? ==&lt;br /&gt;
* See [[Migrating contrib code to 2.0]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Contributed code FAQ]]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/view.php?f=33 General developer forum]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=55719 How does date / time in DB convert to real Date / Time?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=158521 Why git?]&lt;br /&gt;
&lt;br /&gt;
==Learn more==&lt;br /&gt;
&lt;br /&gt;
*Two online courses specifically for Moodle developers [https://www.moodlebites.com/mod/page/view.php?id=24546 Level 1] and [https://www.moodlebites.com/mod/page/view.php?id=19542 Level 2] are run by [http://www.hrdnz.com HRDNZ] (certified Moodle Partner since 2006) specifically helping new Moodle developers get up-to-speed with Moodle development. &lt;br /&gt;
&lt;br /&gt;
[[Category: FAQ]]&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=49574</id>
		<title>User talk:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=49574"/>
		<updated>2016-03-03T07:56:53Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Such a long time since I&#039;ve edited anything here...&lt;br /&gt;
Wow - we&#039;re still using such an old looking editor (but it obviously doesn&#039;t need Atto or similar for a Wiki.&lt;br /&gt;
Anyway, I&#039;m going to start getting into a bit more Moodle development now - not that I will have enough time, or talent, to become of guru :-(&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Here&#039;s our new MoodleBites developer level courses...&lt;br /&gt;
&lt;br /&gt;
MoodleBites for Developers - http://www.moodlebites.com/mod/page/view.php?id=19542&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
MoodleBites Introduction to Moodle Development - http://www.moodlebites.com/mod/page/view.php?id=24546&lt;br /&gt;
&lt;br /&gt;
--[[User:Stuart Mealor|Stuart Mealor]] ([[User talk:Stuart Mealor|talk]]) 15:53, 3 March 2016 (AWST)&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=49573</id>
		<title>User talk:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=49573"/>
		<updated>2016-03-03T07:56:09Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Such a long time since I&#039;ve edited anything here...&lt;br /&gt;
Wow - we&#039;re still using such an old looking editor (but it obviously doesn&#039;t need Atto or similar for a Wiki.&lt;br /&gt;
Anyway, I&#039;m going to start getting into a bit more Moodle development now - not that I will have enough time, or talent, to become of guru :-(&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Here&#039;s our new MoodleBites developer level courses...&lt;br /&gt;
&lt;br /&gt;
MoodleBites for Developers - http://www.moodlebites.com/mod/page/view.php?id=19542&lt;br /&gt;
and &lt;br /&gt;
MoodleBites Introduction to Moodle Development - http://www.moodlebites.com/mod/page/view.php?id=24546&lt;br /&gt;
&lt;br /&gt;
--[[User:Stuart Mealor|Stuart Mealor]] ([[User talk:Stuart Mealor|talk]]) 15:53, 3 March 2016 (AWST)&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=49572</id>
		<title>User talk:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=49572"/>
		<updated>2016-03-03T07:54:00Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Such a long time since I&#039;ve edited anything here...&lt;br /&gt;
Wow - we&#039;re still using such an old looking editor (but it obviously doesn&#039;t need Atto or similar for a Wiki.&lt;br /&gt;
Anyway, I&#039;m going to start getting into a bit more Moodle development now - not that I will have enough time, or talent, to become of guru :-(&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Here&#039;s our new MoodleBites developer level courses...&lt;br /&gt;
&lt;br /&gt;
MoodleBites for Developers - http://www.moodlebites.com/mod/page/view.php?id=19542&lt;br /&gt;
and &lt;br /&gt;
MoodleBites Introduction to Moodle Development - http://www.moodlebites.com/mod/page/view.php?id=24546&lt;br /&gt;
--[[User:Stuart Mealor|Stuart Mealor]] ([[User talk:Stuart Mealor|talk]]) 15:53, 3 March 2016 (AWST)&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=49571</id>
		<title>User talk:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=49571"/>
		<updated>2016-03-03T07:46:58Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Such a long time since I&#039;ve edited anything here...&lt;br /&gt;
Wow - we&#039;re still using such an old looking editor (but it obviously doesn&#039;t need Atto or similar for a Wiki.&lt;br /&gt;
Anyway, I&#039;m going to start getting into a bit more Moodle development now - not that I will have enough time, or talent, to become of guru :-(&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Here&#039;s our new MoodleBites developer level courses...&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Projects_for_new_developers&amp;diff=43995</id>
		<title>Projects for new developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Projects_for_new_developers&amp;diff=43995"/>
		<updated>2014-02-27T00:56:47Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: /* Plagiarism plugin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&lt;br /&gt;
[[File:GSoC2012 logo.png|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Latest news:&#039;&#039;&#039; &#039;&#039;Moodle will be taking part in the [http://socghop.appspot.com/ Google Summer of Code] for our sixth year in 2012!&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re thinking of applying to work with Moodle for GSOC 2012, please check the information on [[Applying to work with Moodle for GSOC]] and join our gsoc2012@conference.moodle.org jabber chat!&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
Moodle uses PHP, JavaScript and a number of other Web languages, so learning those is a good place to start.&lt;br /&gt;
&lt;br /&gt;
When you have some basic PHP programming skills, you may wish to start learning about how to Moodle code is organised. It is recommended that you complete the [http://dev.moodle.org/course/view.php?id=2 Introduction to Moodle Programming] course on [http://dev.moodle.org/ dev.moodle.org]. To access this you will need to have an account on moodle.org first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you are looking for projects suggested in the tracker, look for issues with the [https://tracker.moodle.org/issues/?jql=labels%20in%20%28addon_candidate%29 &#039;addon_candidate&#039; label].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you are looking to make a quick contribution, look for tracker issues with marked as [https://tracker.moodle.org/issues/?jql=Difficulty%20%3D%20Easy easy].&lt;br /&gt;
&lt;br /&gt;
As you become more involved in Moodle development, you might like to learn more about the [[Coding|coding conventions]] used and how changes to Moodle core code are [[Process|processed]].&lt;br /&gt;
&lt;br /&gt;
==Potential projects==&lt;br /&gt;
&lt;br /&gt;
This evolving page lists possible Moodle projects for new developers derived from community suggestions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you have any ideas for new features in Moodle which might be suitable as projects for new developers, please see [[New feature ideas]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== SCORM ===&lt;br /&gt;
&lt;br /&gt;
There are various SCORM related projects I&#039;d be interested in mentoring for GSOC in 2014. &lt;br /&gt;
* Fix/Improve built in SCORM navigation (MDL-25642 MDL-29193 MDL-39551)&lt;br /&gt;
* Improve SCORM performance, PHPDocs, compliance with coding guidelines. - There are a number of known areas of SCORM code that need a clean-up/re-structure - It would be good to audit all the scorm code and make it comply with Moodle&#039;s coding guidelines and improve the performance of the code - it would be good to implement MUC in areas that can make use of it - Ideally we would also rewrite the datamodels/scorm_*_.js.php files to separate the php from the js and make the JavaScript cache-able - (work started on this in MDL-35870) Other related bugs: MDL-41216 MDL-41665 MDL-42314 &lt;br /&gt;
* SCORM reports - there are currently 3 SCORM reports - ideas on new report plugins would be considered as possible projects.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP, JavaScript&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium -&amp;gt; Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
&lt;br /&gt;
===HTML maths editor===&lt;br /&gt;
&lt;br /&gt;
Traditional written mathematical notation takes advantage of a rich set of special symbols, together with their relative size and&lt;br /&gt;
position on a two dimensional page.   Underlying mathematical expressions is a well-defined semantic tree structure.  When typing a mathematical expression into a computer keyboard the ability to take advantage of the features of traditional mathematical notation is severely limited. Essentially one has only a one-dimensional string of symbols taken from the limited alphabet found on computer keyboards and a strict syntax. Syntax is often problematic for users.  For example, they differ between applications and they do not correspond to traditional notation. &lt;br /&gt;
&lt;br /&gt;
DragMath (http://www.dragmath.bham.ac.uk) is a nice &amp;quot;drag and drop&amp;quot; equation editor that has been integrated with the Moodle editor for some time. However, it is implemented in Java, and that is becoming increasingly problematic, with increasing security warnings on the desktop, and limited support on mobile devices. We would like a new editor, keeping all the good parts of DragMath, but written in JavaScript. This could then be integrated with Moodle and other web applications.&lt;br /&gt;
&lt;br /&gt;
Goal: to create a useful and usable &amp;quot;mathematics entry system&amp;quot; for Moodle, using a combination of JavaScript and HTML5.&lt;br /&gt;
&lt;br /&gt;
This should&lt;br /&gt;
* parse typed expressions into an internal tree representation&lt;br /&gt;
* provide useful feedback to users, e.g. &amp;quot;missing bracket&amp;quot;, on ill-formed expressions.&lt;br /&gt;
* have flexible options for providing a &amp;quot;context&amp;quot; to mediate between the requirements of a strict syntax, and users&#039; expectations based on traditional written mathematics.  E.g. is &amp;quot;x(t+1)&amp;quot; a multiplication of x and (t+1) or application of the function &amp;quot;x&amp;quot; to the argument &amp;quot;(t+1)&amp;quot;?&lt;br /&gt;
* have &amp;quot;drag and drop&amp;quot; components (in HTML5)&lt;br /&gt;
* have a modular and flexible output mechanism, this includes&lt;br /&gt;
** on-screen display &amp;quot;as you type/edit&amp;quot; &lt;br /&gt;
** output in a variety of formats, LaTeX, Maxima syntax, MathML etc. which can be embedded into web applications, specifically Moodle.  It is not a goal to provide multiple outputs, but it is a goal to develop a framework in which other users can contribute such formats.&lt;br /&gt;
** show users the internal tree representation on request&lt;br /&gt;
* potentially enable manipulation (computer algebra) of internal expressions by pre-defined rules.&lt;br /&gt;
* have a well documented and simple API.&lt;br /&gt;
&lt;br /&gt;
Much of the basic design has been done in for example&lt;br /&gt;
* DragMath   http://www.dragmath.bham.ac.uk/&lt;br /&gt;
* Numbas     http://www.ncl.ac.uk/maths/numbas/&lt;br /&gt;
* CanvasMath https://code.google.com/p/canvasmath/&lt;br /&gt;
We will draw from this previous design experience to guide the development.&lt;br /&gt;
&lt;br /&gt;
See this forum thread: https://moodle.org/mod/forum/discuss.php?d=251627 for more.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: JavaScript, HTML 5&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentors&#039;&#039;&#039;: Chris Sangwin&lt;br /&gt;
&lt;br /&gt;
===New question types===&lt;br /&gt;
&lt;br /&gt;
This is not really a specific project idea, but I would like to point one an important general area:&lt;br /&gt;
&lt;br /&gt;
With HTML5 the range of what can be done in a web browser keeps expanding. Can we use these possibilities to make new, much more interactive, question types for Moodle? &lt;br /&gt;
&lt;br /&gt;
There are some ideas in this forum thread: https://moodle.org/mod/forum/discuss.php?d=222439&lt;br /&gt;
* a question type where students have to join things up correctly by adding lines to a diagram (for example to complete an electric circuit).&lt;br /&gt;
* a question type where students can change the colour of certain parts of a diagram, and they have to get it correct.&lt;br /&gt;
* ... I am sure there are more possible ideas. Use your imagination!&lt;br /&gt;
&lt;br /&gt;
There are also some ideas which don&#039;t require complex HTML5 things:&lt;br /&gt;
* A &#039;Give 3 examples of ...&#039; Question type. For example &amp;quot;Give three ways to speed up a chemical reaction:&amp;quot;. Answer &#039;heat&#039;, &#039;increase concentration&#039;, &#039;catalyst&#039; (in any order). However, &#039;warm it&#039; might be an acceptable alternative, but &#039;heat&#039;, &#039;catalyst&#039;, &#039;warm it&#039; should only score 2/3.&lt;br /&gt;
* An ordering question type. Probably based on the OU&#039;s qtype_ddwtos. The think that cannot do is give good credit for partially correct answer. For example &#039;F&#039;, &#039;A&#039;, &#039;B&#039;, &#039;C&#039;, &#039;D&#039;, &#039;E&#039; might be considered close to the right order, but if you do that with ddwtos it will score 0.&lt;br /&gt;
* A question type where students must highlight certain words in some text. E.g. &amp;quot;Find all the verbs in this paragraph.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
There is also scope to make significant enhancements to existing question types. For example&lt;br /&gt;
* in [https://moodle.org/plugins/view.php?plugin=qtype_ddmarker Drag and drop markers] allow teachers to define the drop zones by dragging with the mouse, rather than typing co-ordinates.&lt;br /&gt;
* in [https://moodle.org/plugins/view.php?plugin=qtype_pmatch the pattern-match question type] a tool like STACK question tests to help teachers verify that their answer matching works correctly (upload example responses, indicate what grade they should receive, show what grade they actually receive, and highlight the differences.&lt;br /&gt;
&lt;br /&gt;
Before proposing anything, please make sure you are familiar with the [https://docs.moodle.org/22/en/Questions standard question types] already available in Moodle, and the [http://moodle.org/plugins/browse.php?list=category&amp;amp;id=29 contributed question types] that other people have already created.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP &amp;amp; JavaScript&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium - Hard&lt;br /&gt;
:&#039;&#039;&#039;Possible mentors&#039;&#039;&#039;: Tim Hunt&lt;br /&gt;
&lt;br /&gt;
=== Plagiarism plugin ===&lt;br /&gt;
&lt;br /&gt;
There are various commercial plugins available that use the Plagiarism API in Moodle, but because these plagiarism systems can require paid subscriptions, testing them can be difficult. I&#039;d like to see a basic plugin developed that could be used for testing the Plagiarism API, providing simple useful functionality. All Plagiarism API functions for all Modules that support the API should be implemented and used. It could check the file contenthash against all other files uploaded in the Moodle files table and if a matching record is found it should display information about the duplicate submission including if the same student has submitted the file in a different course/activity or if a different user has uploaded the file with the same contenthash.&lt;br /&gt;
&lt;br /&gt;
The first stage of this project is to implement very simple high performing code that allows easy testing of the Plagiarism API and provide some very basic functionality by checking the contenthash &lt;br /&gt;
This code should implement unit tests and behat tests so that we can verify that the Moodle Plagiarism API is functioning correctly.&lt;br /&gt;
&lt;br /&gt;
The long term plan (possibly after GSOC) would be to get this plugin to post content to an external source which could implement a more complete plagiarism check running on a separate server so it doesn&#039;t affect performance of the Moodle site. The Plagiarism plugin &amp;quot;Crot&amp;quot; may have some code that could be repurposed to use for this.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=21591&amp;amp;course=5 Dan Marsden]&lt;br /&gt;
:&#039;&#039;&#039;Discussion&#039;&#039;&#039;: [http://dev.moodle.org/mod/forum/discuss.php?d=1822]&lt;br /&gt;
&lt;br /&gt;
=== Per-discussion subscription in Forums ===&lt;br /&gt;
&lt;br /&gt;
The facility for per-discussion subscription in Forums is a Feature Request in the Moodle Tracker dating back to 2004(!), with 149 votes, and almost 100 people watching or participating. [https://tracker.moodle.org/browse/MDL-1626]&lt;br /&gt;
&lt;br /&gt;
This might not be sexy enough for a Summer of Code project, or perhaps even too difficult to implement within the time available?&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Skills required&#039;&#039;&#039;: PHP&lt;br /&gt;
:&#039;&#039;&#039;Difficulty level&#039;&#039;&#039;: Medium-Advanced&lt;br /&gt;
:&#039;&#039;&#039;Possible mentor&#039;&#039;&#039;: &lt;br /&gt;
:&#039;&#039;&#039;Discussion&#039;&#039;&#039;: [https://moodle.org/mod/forum/discuss.php?d=243959]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC]] - describing Moodle&#039;s involvement with Google in their Summer of Code program&lt;br /&gt;
* [http://tracker.moodle.org/secure/IssueNavigator!executeAdvanced.jspa?jqlQuery=type+in+%28%22New+Feature%22%2C+Improvement%29+AND+resolution+%3D+unresolved+ORDER+BY+votes+DESC&amp;amp;runQuery=true&amp;amp;clear=true Popular new feature and improvement requests in Tracker]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=24067</id>
		<title>User talk:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User_talk:Stuart_Mealor&amp;diff=24067"/>
		<updated>2009-09-10T21:07:56Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: New page: This is my talk page eh?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is my talk page eh?&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21937</id>
		<title>User:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21937"/>
		<updated>2009-08-27T05:23:32Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi :-)&lt;br /&gt;
* I&#039;m Managing Director of &#039;&#039;[http://www.hrdnz.com HRDNZ]&#039;&#039;, Moodle Partner in New Zealand.&lt;br /&gt;
We run the &#039;&#039;[http://www.moodlemoot.co.nz Moodle Moot]&#039;&#039; in NZ each year &lt;br /&gt;
* I&#039;m Moodle Certification Manager - which is currently the Moodle Course Creator Certificate (MCCC) &#039;&#039;[http://moodle.org/course/view.php?id=48 Moodle Certification]&#039;&#039;.&lt;br /&gt;
* I&#039;m also joint facilitator of the &#039;&#039;[http://moodle.org/course/view.php?id=32 Moodle Business Uses]&#039;&#039; area (Also run the &#039;&#039;[http://www.linkedin.com/groups?gid=128299 Linkedin MoodleUsers Group]&#039;&#039;&lt;br /&gt;
* I&#039;ve presented at Moodle Moots meeting fantastic people along the way(!) in:&lt;br /&gt;
** Australia (Sydney and Brisbane)&lt;br /&gt;
** Muscat (Oman)&lt;br /&gt;
** Rome (Italy)&lt;br /&gt;
** Barcelona (Spain)&lt;br /&gt;
** San Francisco twice and Oklahoma (USA)&lt;br /&gt;
** 5(!) Moots in New Zealand.&lt;br /&gt;
** Also you might have met me at LearnX, E-Fest, ULearn, or Ascilite conferences.&lt;br /&gt;
&lt;br /&gt;
Please say hello on my [[User talk:Stuart Mealor|talk page]] :-)&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21936</id>
		<title>User:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21936"/>
		<updated>2009-08-27T05:19:37Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi :-)&lt;br /&gt;
* I&#039;m Managing Director of &#039;&#039;[http://www.hrdnz.com HRDNZ]&#039;&#039;, Moodle Partner in New Zealand.&lt;br /&gt;
We run the &#039;&#039;[http://www.moodlemoot.co.nz Moodle Moot]&#039;&#039; in NZ each year &lt;br /&gt;
* I&#039;m Moodle Certification Manager - which is currently the Moodle Course Creator Certificate (MCCC) &#039;&#039;[http://moodle.org/course/view.php?id=48 Moodle Certification]&#039;&#039;.&lt;br /&gt;
* I&#039;m also joint facilitator of the &#039;&#039;[http://moodle.org/course/view.php?id=32 Moodle Business Uses]&#039;&#039; area &lt;br /&gt;
* I&#039;ve presented at Moodle Moots meeting fantastic people along the way(!) in:&lt;br /&gt;
** Australia (Sydney and Brisbane)&lt;br /&gt;
** Muscat (Oman)&lt;br /&gt;
** Rome (Italy)&lt;br /&gt;
** Barcelona (Spain)&lt;br /&gt;
** San Francisco twice and Oklahoma (USA)&lt;br /&gt;
** 5(!) Moots in New Zealand.&lt;br /&gt;
** Also you might have met me at LearnX, E-Fest, ULearn, or Ascilite conferences.&lt;br /&gt;
&lt;br /&gt;
Please say hello on my [[User talk:Stuart Mealor|talk page]] :-)&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21935</id>
		<title>User:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21935"/>
		<updated>2009-08-27T05:09:18Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi :-)&lt;br /&gt;
* I&#039;m Managing Director of HRDNZ, Moodle Partner in New Zealand.&lt;br /&gt;
We run the &#039;&#039;[http://www.moodlemoot.co.nz Moodle Moot]&#039;&#039; in NZ each year &lt;br /&gt;
* I&#039;m Moodle Certification Manager - which is currently the Moodle Course Creator Certificate (MCCC) &#039;&#039;[http://moodle.org/course/view.php?id=48 Moodle Certification]&#039;&#039;.&lt;br /&gt;
* I&#039;m also joint facilitator of the &#039;&#039;[http://moodle.org/course/view.php?id=32 Moodle Business Uses]&#039;&#039; area &lt;br /&gt;
* I&#039;ve presented at Moodle Moots in:&lt;br /&gt;
** Australia (Sydney and Brisbane)&lt;br /&gt;
** Muscat (Oman)&lt;br /&gt;
** Rome (Italy)&lt;br /&gt;
** Barcelona (Spain)&lt;br /&gt;
** San Francisco x2 and Oklahoma (USA)&lt;br /&gt;
** 5(!) Moots in New Zealand.&lt;br /&gt;
** Also you might have met me at LearnX, E-Fest, ULearn, or Ascilite conferences.&lt;br /&gt;
&lt;br /&gt;
Please say hello on my [[User talk:Stuart Mealor|talk page]] :-)&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21934</id>
		<title>User:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21934"/>
		<updated>2009-08-27T05:07:41Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi :-)&lt;br /&gt;
* I&#039;m Managing Director of HRDNZ, Moodle Partner in New Zealand.&lt;br /&gt;
We run the &#039;&#039;[http://www.moodlemoot.co.nz Moodle Moot]&#039;&#039; in NZ each year &lt;br /&gt;
* I&#039;m Moodle Certification Manager - which is currently the Moodle Course Creator Certificate (MCCC) &#039;&#039;[http://moodle.org/course/view.php?id=48 Moodle Certification]&#039;&#039;.&lt;br /&gt;
* I&#039;m also joint facilitator of the Moodle Business Uses area &#039;&#039;[http://moodle.org/course/view.php?id=32 Moodle Business Uses]&#039;&#039;&lt;br /&gt;
* I&#039;ve presented at Moodle Moots in&lt;br /&gt;
** Australia (Sydney and Brisbane)&lt;br /&gt;
** Muscat (Oman)&lt;br /&gt;
** Rome (Italy)&lt;br /&gt;
** Barcelona (Spain)&lt;br /&gt;
** San Francisco x2 and Oklahoma (USA)&lt;br /&gt;
** 5 Moots in New Zealand.&lt;br /&gt;
** Also you might have met me at LearnX, E-Fest, ULearn, or Ascilite conferences.&lt;br /&gt;
&lt;br /&gt;
Please say hello on my [[User talk:Stuart Mealor|talk page]] :-)&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21933</id>
		<title>User:Stuart Mealor</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Stuart_Mealor&amp;diff=21933"/>
		<updated>2009-08-27T04:55:30Z</updated>

		<summary type="html">&lt;p&gt;Stuartrmealor: New page: Hi :-) * I&amp;#039;m Managing Director of HRDNZ, Moodle Partner in New Zealand. We run the &amp;#039;&amp;#039;[http://moodle.org/course/view.php?id=32 Moodle Moot]&amp;#039;&amp;#039; in NZ each year  * I&amp;#039;m Moodle Certification Man...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi :-)&lt;br /&gt;
* I&#039;m Managing Director of HRDNZ, Moodle Partner in New Zealand.&lt;br /&gt;
We run the &#039;&#039;[http://moodle.org/course/view.php?id=32 Moodle Moot]&#039;&#039; in NZ each year &lt;br /&gt;
* I&#039;m Moodle Certification Manager - which is currently the Moodle Course Creator Certificate (MCCC) &#039;&#039;[http://moodle.org/course/view.php?id=48 Moodle Certification]&#039;&#039;.&lt;br /&gt;
* I&#039;m also joint facilitator of the Moodle Business Uses area &#039;&#039;[http://moodle.org/course/view.php?id=32 Moodle Business Uses]&#039;&#039;&lt;br /&gt;
* I&#039;ve presented at Moodle Moots in Australia (Sydney and Brisbane), Muscat (Oman), Rome (Italy), Barcelona (Spain), San Francisco x2 and Oklahoma (USA), as well as 5 Moots in New Zealand.  Also you might have met me at LearnX, E-Fest, ULearn, or Ascilite conferences.&lt;br /&gt;
&lt;br /&gt;
Please say hello on my [[User talk:Stuart Mealor|talk page]] :-)&lt;/div&gt;</summary>
		<author><name>Stuartrmealor</name></author>
	</entry>
</feed>