<?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=Jethac</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=Jethac"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Jethac"/>
	<updated>2026-06-06T08:01:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Developer_meeting_July_2015&amp;diff=48300</id>
		<title>Developer meeting July 2015</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Developer_meeting_July_2015&amp;diff=48300"/>
		<updated>2015-07-19T23:40:57Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* Agenda */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Developer meetings]] &amp;gt; July 2015 meeting notes&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Time&lt;br /&gt;
| [http://www.timeanddate.com/worldclock/fixedtime.html?year=2015&amp;amp;month=7&amp;amp;day=21&amp;amp;hour=07&amp;amp;min=0&amp;amp;sec=0 07:00 UTC on Tuesday, 21 July 2015] [http://www.google.com/calendar/event?action=TEMPLATE&amp;amp;text=Moodle+General+developer+meeting&amp;amp;dates=20150721T070000Z/20150721T090000Z&amp;amp;details=&amp;amp;location= &amp;lt;span class=&amp;quot;btn btn-info&amp;quot;&amp;gt;Add to my calendar&amp;lt;/span&amp;gt;]&lt;br /&gt;
|-&lt;br /&gt;
| Meeting room&lt;br /&gt;
| [https://www.youtube.com/watch?v=pgPBohzErr4 Live stream at YouTube]&lt;br /&gt;
|-&lt;br /&gt;
| Forum discussion&lt;br /&gt;
| [https://moodle.org/mod/forum/discuss.php?d=316807 Thread in GDF at moodle.org]&lt;br /&gt;
|-&lt;br /&gt;
| Chat&lt;br /&gt;
| [https://moodle.org/local/chatlogs/info.php Regular dev chat]&lt;br /&gt;
|-&lt;br /&gt;
| Twitter&lt;br /&gt;
| [https://twitter.com/search?q=%23moodledev #moodledev]&lt;br /&gt;
|-&lt;br /&gt;
| Social event page&lt;br /&gt;
| [https://plus.google.com/events/c63rl8n5jdjldr9slcd1tdcqmg0 Google+ page]&lt;br /&gt;
|-&lt;br /&gt;
| Meeting notes&lt;br /&gt;
| [https://devpad.moodle.org/p/gdm150721 devpad]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Agenda ==&lt;br /&gt;
&lt;br /&gt;
* Moodle Mobile 2 - Juan Leyva&lt;br /&gt;
* Summary report of the recent Moodle hackfests (Dublin, Melbourne) - David Mudrák, Andrew Nicols&lt;br /&gt;
* Moodle Association and how it is supposed to affect the Moodle development in the future - Martin Dougiamas&lt;br /&gt;
* Moodle HQ&#039;s personal projects week products - HQ devs&lt;br /&gt;
** Improved East Asian support (ruby tags in Atto and in fullname()) - Jetha Chan&lt;br /&gt;
* Work in progress on Learning plans and outcomes project for Moodle 3.0 - Damyon (to be confirmed)&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Please feel encouraged to raise topics you would like to present / discuss during the meeting. Contact [https://moodle.org/user/profile.php?id=1601 David Mudrák] for details.&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Damyon_Wiese/Templates&amp;diff=47519</id>
		<title>User:Damyon Wiese/Templates</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Damyon_Wiese/Templates&amp;diff=47519"/>
		<updated>2015-03-18T09:23:51Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* How do I call a template from javascript? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Templates =&lt;br /&gt;
&lt;br /&gt;
== What is a template? ==&lt;br /&gt;
A template is an alternative to writing blocks of html directly in javascript / php by concatenating strings. The end result is the same, but templates have a number of advantages:&lt;br /&gt;
* It is easier to see the final result of the template because the code for a template is very close to what the final HTML will look like&lt;br /&gt;
* Because the templating language is intentionally limited, it is hard to introduce complex logic into a template. This make it far easier for a theme designer to override a template, without breaking the logic&lt;br /&gt;
* Templates can be rendered from javascript. This allows ajax operations to re-render a portion of the page.&lt;br /&gt;
&lt;br /&gt;
== How do I write a template? ==&lt;br /&gt;
Templates are written in a language called &amp;quot;[http://mustache.github.io/mustache.5.html Mustache]&amp;quot;. Mustache is written as HTML with additional tags used to format the display of the data. Mustache tags are made of 2 opening and closing curly braces &amp;quot;{{tag}}&amp;quot;. There are a few variations of these tags that behave differently.&lt;br /&gt;
* &amp;lt;code xml&amp;gt;{{raiden}}&amp;lt;/code&amp;gt; This is a simple variable substitution. The variable named &amp;quot;variable&amp;quot; will be searched for in the current context (and any parent contexts) and when a value is found, the entire tag will be replaced by the variable (html escaped).&lt;br /&gt;
* &amp;lt;code xml&amp;gt;{{{galaga}}}&amp;lt;/code&amp;gt; This is an unescaped variable substitution. Instead of escaping the variable before replacing it in the template, the variable is included raw. This is useful when the variable contains a block of HTML (for example).&lt;br /&gt;
* &amp;lt;code xml&amp;gt;{{#lemmings}} jump off cliff {{/#lemmings}}&amp;lt;/code&amp;gt; These are opening and closing section tags. If the lemmings variable exists and evaluates to &amp;quot;not false&amp;quot; value, the variable is pushed on the stack, the contents of the are section parsed and included in the result. If the variable does not exist, or evaluates to false - the section will be skipped. If the variable lemmings evaluates to an array, the section will be repeated for each item in the array with the items of the array on the context. This is how to output a list.&lt;br /&gt;
* &amp;lt;code xml&amp;gt;{{&amp;gt; pacman }}&amp;lt;/code&amp;gt; This is a partial. Think of it like an include. Templates can include other templates using this tag.&lt;br /&gt;
&lt;br /&gt;
So - putting this all together:&lt;br /&gt;
&lt;br /&gt;
recipe.mustache&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;{{recipename}}&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;{{description}}&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Ingredients&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
{{#ingredients}}&lt;br /&gt;
&amp;lt;li&amp;gt;{{.}}&amp;lt;/li&amp;gt;&lt;br /&gt;
{{/ingredients}}&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Steps&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
{{#steps}}&lt;br /&gt;
&amp;lt;li&amp;gt;{{{.}}}&amp;lt;/li&amp;gt;&lt;br /&gt;
{{/steps}}&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
{{ &amp;gt; ratethisrecipe }}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When given this data:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  recipename: &amp;quot;Cheese sandwich&amp;quot;,&lt;br /&gt;
  description: &amp;quot;Who doesn&#039;t like a good cheese sandwich?&amp;quot;,&lt;br /&gt;
  ingredients: [&amp;quot;bread&amp;quot;, &amp;quot;cheese&amp;quot;, &amp;quot;butter&amp;quot;],&lt;br /&gt;
  steps: [&amp;quot;&amp;lt;p&amp;gt;Step 1 is to spread the butter on the bread&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;&amp;lt;p&amp;gt;Step 2 is to put the cheese &amp;amp;quot;in&amp;amp;quot; the bread (not on top, or underneath)&amp;lt;/p&amp;gt;&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gives this: &amp;lt;span style=&amp;quot;font-size:4em&amp;quot;&amp;gt;😋&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More info - there are much clearer explanations of templates on the [http://mustache.github.io/mustache.5.html Mustache] website. Try reading those pages &amp;quot;before&amp;quot; posting on stack overflow :) .&lt;br /&gt;
&lt;br /&gt;
== Where do I put my templates? ==&lt;br /&gt;
&lt;br /&gt;
Templates go in the &amp;lt;componentdir&amp;gt;/templates folder and must have a .mustache file extension. When loading templates the template name is &amp;lt;componentname&amp;gt;/&amp;lt;filename&amp;gt; (no file extension). &lt;br /&gt;
&lt;br /&gt;
So &amp;quot;mod_lesson/timer&amp;quot; would load the template at mod/lesson/templates/timer.mustache.&lt;br /&gt;
&lt;br /&gt;
== How do I call a template from javascript? ==&lt;br /&gt;
&lt;br /&gt;
Rendering a template from javascript is fairly easy. There is a new AMD module that can load/cache and render a template for you. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
// This is AMD code for loading the &amp;quot;core/templates&amp;quot; module. see [User:Damyon_Wiese/Javascript_Modules Javascript Modules].&lt;br /&gt;
require([&#039;core/templates&#039;], function(templates) {&lt;br /&gt;
&lt;br /&gt;
    // This will be the context for our template. So {{name}} in the template will resolve to &amp;quot;Tweety bird&amp;quot;.&lt;br /&gt;
    var context = { name: &#039;Tweety bird&#039;, intelligence: 2 };&lt;br /&gt;
&lt;br /&gt;
    // This will call the function to load and render our template. &lt;br /&gt;
    var promise = templates.render(&#039;block_looneytunes/profile&#039;, context);&lt;br /&gt;
&lt;br /&gt;
    // The promise object returned by this function means &amp;quot;I&#039;ve considered your request and will finish it later - I PROMISE!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    // How we deal with promise objects is by adding callbacks.&lt;br /&gt;
    promise.done(function(source, javascript) {&lt;br /&gt;
        // Here eventually I have my compiled template, and any javascript that it generated.&lt;br /&gt;
    });&lt;br /&gt;
  &lt;br /&gt;
    // Sometimes things fail&lt;br /&gt;
    promise.fail(function(ex) {&lt;br /&gt;
        // Deal with this exception (I recommend core/notify exception function for this).&lt;br /&gt;
    });&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under the hood, this did many clever things for us. It loaded the template via an ajax call if it was not cached. It found any missing lang strings in the template and loaded them in a single ajax request, it split the JS from the HTML and returned us both in easy to use way. Read on for how to nicely deal with the javascript parameter.&lt;br /&gt;
&lt;br /&gt;
Note: with some nice chaining and sugar, we can shorten the above example quite a bit:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
require([&#039;core/templates&#039;, &#039;core/notification&#039;], function(templates, notification) {&lt;br /&gt;
    var context = { name: &#039;Tweety bird&#039;, intelligence: 2 };&lt;br /&gt;
    templates.renderTemplate(&#039;block_looneytunes/profile&#039;, context)&lt;br /&gt;
        .done(doneCallback)&lt;br /&gt;
        .fail(notification.exception);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What if a template contains javascript? ==&lt;br /&gt;
&lt;br /&gt;
Sometimes a template requires that some JS be run when it is added to the page in order to give it more features. In the template we can include blocks of javascript, but we should use a special section tag that has a &amp;quot;helper&amp;quot; method registered to handle javascript carefully. &lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
profile.mustache&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;profile&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Name: {{name}}&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Intelligence: {{intelligence}}&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{#js}}&lt;br /&gt;
require(&#039;jquery&#039;, function($) {&lt;br /&gt;
    // Effects! Can we have &amp;quot;blink&amp;quot;?&lt;br /&gt;
    $(&#039;#profile&#039;).slideDown();&lt;br /&gt;
});&lt;br /&gt;
{{/js}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If this template is rendered by PHP, the javascript is separated from the HTML, and is appended to a special section in the footer of the page &amp;quot;after&amp;quot; requirejs has loaded. This provides the optimal page loading speed. If the template is rendered by javascript, the javascript source will be passed to the &amp;quot;done&amp;quot; handler from the promise. Then, when the &amp;quot;done&amp;quot; handler has added the template to the DOM, it can call &lt;br /&gt;
&amp;lt;code javascript&amp;gt;templates.runTemplateJS(javascript);&amp;lt;/code&amp;gt; &lt;br /&gt;
which will create a new script tag and append it to the page head.&lt;br /&gt;
&lt;br /&gt;
== What other helpers can I use? ==&lt;br /&gt;
There is a string helper for loading language strings.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
{{#str}} iscool, mod_cool, David Beckham {{/str}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first 2 words are the string id and the component name, the rest of the section is the content for the $a variable. So this example would call get_string(&#039;iscool&#039;, &#039;mod_cool&#039;, &#039;David Beckham&#039;);&lt;br /&gt;
&lt;br /&gt;
Variables are allowed in the text for the $a param. &lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
{{#str}} iscool, mod_cool, {{name}} {{/str}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For strings that accept complex $a params, you can use a json object here instead:&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
{{#str}} iscool, mod_cool, { firstname: &#039;David&#039;, lastname: &#039;Beckham&#039;}{{/str}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a pix icon helper for generating pix icon tags.&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
{{#pix}} t/edit core Edit David Beckham {{/pix}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first 2 words are the string id and the component name, the rest is the alt text for the image.&lt;br /&gt;
&lt;br /&gt;
== How do I call a template from php? ==&lt;br /&gt;
&lt;br /&gt;
The templates in php are attached to the renderers. There is a renderer method &amp;quot;render_from_template($templatename, $context)&amp;quot; that does the trick.&lt;br /&gt;
&lt;br /&gt;
== How do templates work with renderers? ==&lt;br /&gt;
&lt;br /&gt;
Extra care must be taken to ensure that the data passed to the context parameter is useful to the templating language. The template language cannot:&lt;br /&gt;
* Call functions&lt;br /&gt;
* Perform any boolean logic&lt;br /&gt;
* Render renderables&lt;br /&gt;
* Do capability checks&lt;br /&gt;
* Make DB queries&lt;br /&gt;
&lt;br /&gt;
So - I have &amp;quot;some&amp;quot; data in my renderable and some logic and html generation in my render method for that renderable - how do I refactor this to use a template?&lt;br /&gt;
&lt;br /&gt;
The first thing to note, is that you don&#039;t have to use a template if you don&#039;t want to. It just means that themers will still have to override your render method, instead of just overriding the template. But if you DO want to use a template, you will earn &amp;quot;cred&amp;quot; with themers, and you will be able to re-render parts of your interface from javascript in response to ajax requests without reloading the whole page (that&#039;s cool).&lt;br /&gt;
&lt;br /&gt;
There is a simple pattern to use to hook a template into a render method. If you make your renderable implement templatable as well as renderable - it will have to implement a new method &amp;quot;export_for_template(renderer_base $output)&amp;quot;. This method takes the data stored in the renderable and &amp;quot;flattens it&amp;quot; so it can be used in a template. If there is some nested data in the renderable (like other renderables) and they do not support templates, they can be &amp;quot;rendered&amp;quot; into the flat data structure using the renderer parameter. It should return an stdClass with properties that are only made of simple types: int, string, bool, float, stdClass or arrays of these types. Then the render method can updated to export the data and render it with the template.&lt;br /&gt;
&lt;br /&gt;
In the renderable:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 /**&lt;br /&gt;
     * Export this data so it can be used as the context for a mustache template.&lt;br /&gt;
     *&lt;br /&gt;
     * @return stdClass&lt;br /&gt;
     */&lt;br /&gt;
    public function export_for_template(renderer_base $output) {&lt;br /&gt;
        $data = new stdClass();&lt;br /&gt;
        $data-&amp;gt;canmanage = $this-&amp;gt;canmanage;&lt;br /&gt;
        $data-&amp;gt;things = array();&lt;br /&gt;
        foreach ($this-&amp;gt;things as $thing) {&lt;br /&gt;
            $data-&amp;gt;things[] = $thing-&amp;gt;to_record();&lt;br /&gt;
        }&lt;br /&gt;
        $data-&amp;gt;navigation = array();&lt;br /&gt;
        foreach ($this-&amp;gt;navigation as $button) {&lt;br /&gt;
            $data-&amp;gt;navigation[] = $output-&amp;gt;render($button);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return $data;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the renderer class:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    /**&lt;br /&gt;
     * Defer to template.&lt;br /&gt;
     *&lt;br /&gt;
     * @param mywidget $widget&lt;br /&gt;
     *&lt;br /&gt;
     * @return string html for the page&lt;br /&gt;
     */&lt;br /&gt;
    render(mywidget $widget) {&lt;br /&gt;
        $data = $widget-&amp;gt;export_for_template($this);&lt;br /&gt;
        retrn self::render_from_template(&#039;mywidget&#039;, $data);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to I override a template in my theme? ==&lt;br /&gt;
&lt;br /&gt;
Templates can be overridden a bit easier than overriding a renderer. First - find the template that you want to change. E.g. &amp;quot;mod/wiki/templates/ratingui.mustache&amp;quot;. Now, create a sub-folder under your themes &amp;quot;templates&amp;quot; directory with the component name of the plugin you are overriding. E.g &amp;quot;theme/timtam/templates/mod_wiki&amp;quot;. Finally, copy the ratingui.mustache file into the newly created &amp;quot;theme/timtam/templates/mod_wiki&amp;quot; and edit it. You should see your changes immediately if theme designer mode is on. Note: templates are cached just like CSS, so if you are not using theme designer mode you will need to purge all caches to see the latest version of an edited template.&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Damyon_Wiese/Templates&amp;diff=47518</id>
		<title>User:Damyon Wiese/Templates</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Damyon_Wiese/Templates&amp;diff=47518"/>
		<updated>2015-03-18T07:09:27Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* How do templates work with renderers? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Templates =&lt;br /&gt;
&lt;br /&gt;
== What is a template? ==&lt;br /&gt;
A template is an alternative to writing blocks of html directly in javascript / php by concatenating strings. The end result is the same, but templates have a number of advantages:&lt;br /&gt;
* It is easier to see the final result of the template because the code for a template is very close to what the final HTML will look like&lt;br /&gt;
* Because the templating language is intentionally limited, it is hard to introduce complex logic into a template. This make it far easier for a theme designer to override a template, without breaking the logic&lt;br /&gt;
* Templates can be rendered from javascript. This allows ajax operations to re-render a portion of the page.&lt;br /&gt;
&lt;br /&gt;
== How do I write a template? ==&lt;br /&gt;
Templates are written in a language called &amp;quot;[http://mustache.github.io/mustache.5.html Mustache]&amp;quot;. Mustache is written as HTML with additional tags used to format the display of the data. Mustache tags are made of 2 opening and closing curly braces &amp;quot;{{tag}}&amp;quot;. There are a few variations of these tags that behave differently.&lt;br /&gt;
* &amp;lt;code xml&amp;gt;{{raiden}}&amp;lt;/code&amp;gt; This is a simple variable substitution. The variable named &amp;quot;variable&amp;quot; will be searched for in the current context (and any parent contexts) and when a value is found, the entire tag will be replaced by the variable (html escaped).&lt;br /&gt;
* &amp;lt;code xml&amp;gt;{{{galaga}}}&amp;lt;/code&amp;gt; This is an unescaped variable substitution. Instead of escaping the variable before replacing it in the template, the variable is included raw. This is useful when the variable contains a block of HTML (for example).&lt;br /&gt;
* &amp;lt;code xml&amp;gt;{{#lemmings}} jump off cliff {{/#lemmings}}&amp;lt;/code&amp;gt; These are opening and closing section tags. If the lemmings variable exists and evaluates to &amp;quot;not false&amp;quot; value, the variable is pushed on the stack, the contents of the are section parsed and included in the result. If the variable does not exist, or evaluates to false - the section will be skipped. If the variable lemmings evaluates to an array, the section will be repeated for each item in the array with the items of the array on the context. This is how to output a list.&lt;br /&gt;
* &amp;lt;code xml&amp;gt;{{&amp;gt; pacman }}&amp;lt;/code&amp;gt; This is a partial. Think of it like an include. Templates can include other templates using this tag.&lt;br /&gt;
&lt;br /&gt;
So - putting this all together:&lt;br /&gt;
&lt;br /&gt;
recipe.mustache&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;{{recipename}}&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;{{description}}&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Ingredients&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
{{#ingredients}}&lt;br /&gt;
&amp;lt;li&amp;gt;{{.}}&amp;lt;/li&amp;gt;&lt;br /&gt;
{{/ingredients}}&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Steps&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
{{#steps}}&lt;br /&gt;
&amp;lt;li&amp;gt;{{{.}}}&amp;lt;/li&amp;gt;&lt;br /&gt;
{{/steps}}&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
{{ &amp;gt; ratethisrecipe }}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When given this data:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  recipename: &amp;quot;Cheese sandwich&amp;quot;,&lt;br /&gt;
  description: &amp;quot;Who doesn&#039;t like a good cheese sandwich?&amp;quot;,&lt;br /&gt;
  ingredients: [&amp;quot;bread&amp;quot;, &amp;quot;cheese&amp;quot;, &amp;quot;butter&amp;quot;],&lt;br /&gt;
  steps: [&amp;quot;&amp;lt;p&amp;gt;Step 1 is to spread the butter on the bread&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;&amp;lt;p&amp;gt;Step 2 is to put the cheese &amp;amp;quot;in&amp;amp;quot; the bread (not on top, or underneath)&amp;lt;/p&amp;gt;&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gives this: &amp;lt;span style=&amp;quot;font-size:4em&amp;quot;&amp;gt;😋&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More info - there are much clearer explanations of templates on the [http://mustache.github.io/mustache.5.html Mustache] website. Try reading those pages &amp;quot;before&amp;quot; posting on stack overflow :) .&lt;br /&gt;
&lt;br /&gt;
== Where do I put my templates? ==&lt;br /&gt;
&lt;br /&gt;
Templates go in the &amp;lt;componentdir&amp;gt;/templates folder and must have a .mustache file extension. When loading templates the template name is &amp;lt;componentname&amp;gt;/&amp;lt;filename&amp;gt; (no file extension). &lt;br /&gt;
&lt;br /&gt;
So &amp;quot;mod_lesson/timer&amp;quot; would load the template at mod/lesson/templates/timer.mustache.&lt;br /&gt;
&lt;br /&gt;
== How do I call a template from javascript? ==&lt;br /&gt;
&lt;br /&gt;
Rendering a template from javascript is fairly easy. There is a new AMD module that can load/cache and render a template for you. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
// This is AMD code for loading the &amp;quot;core/templates&amp;quot; module. see [User:Damyon_Wiese/Javascript_Modules Javascript Modules].&lt;br /&gt;
require([&#039;core/templates&#039;], function(templates) {&lt;br /&gt;
&lt;br /&gt;
    // This will be the context for our template. So {{name}} in the template will resolve to &amp;quot;Tweety bird&amp;quot;.&lt;br /&gt;
    var context = { name: &#039;Tweety bird&#039;, intelligence: 2 };&lt;br /&gt;
&lt;br /&gt;
    // This will call the function to load and render our template. &lt;br /&gt;
    var promise = templates.renderTemplate(&#039;block_looneytunes/profile&#039;, context);&lt;br /&gt;
&lt;br /&gt;
    // The promise object returned by this function means &amp;quot;I&#039;ve considered your request and will finish it later - I PROMISE!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    // How we deal with promise objects is by adding callbacks.&lt;br /&gt;
    promise.done(function(source, javascript) {&lt;br /&gt;
        // Here eventually I have my compiled template, and any javascript that it generated.&lt;br /&gt;
    });&lt;br /&gt;
  &lt;br /&gt;
    // Sometimes things fail&lt;br /&gt;
    promise.fail(function(ex) {&lt;br /&gt;
        // Deal with this exception (I recommend core/notify exception function for this).&lt;br /&gt;
    });&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Under the hood, this did many clever things for us. It loaded the template via an ajax call if it was not cached. It found any missing lang strings in the template and loaded them in a single ajax request, it split the JS from the HTML and returned us both in easy to use way. Read on for how to nicely deal with the javascript parameter.&lt;br /&gt;
&lt;br /&gt;
Note: with some nice chaining and sugar, we can shorten the above example quite a bit:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
require([&#039;core/templates&#039;, &#039;core/notification&#039;], function(templates, notification) {&lt;br /&gt;
    var context = { name: &#039;Tweety bird&#039;, intelligence: 2 };&lt;br /&gt;
    templates.renderTemplate(&#039;block_looneytunes/profile&#039;, context)&lt;br /&gt;
        .done(doneCallback)&lt;br /&gt;
        .fail(notification.exception);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What if a template contains javascript? ==&lt;br /&gt;
&lt;br /&gt;
Sometimes a template requires that some JS be run when it is added to the page in order to give it more features. In the template we can include blocks of javascript, but we should use a special section tag that has a &amp;quot;helper&amp;quot; method registered to handle javascript carefully. &lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
profile.mustache&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;profile&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Name: {{name}}&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Intelligence: {{intelligence}}&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{#js}}&lt;br /&gt;
require(&#039;jquery&#039;, function($) {&lt;br /&gt;
    // Effects! Can we have &amp;quot;blink&amp;quot;?&lt;br /&gt;
    $(&#039;#profile&#039;).slideDown();&lt;br /&gt;
});&lt;br /&gt;
{{/js}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If this template is rendered by PHP, the javascript is separated from the HTML, and is appended to a special section in the footer of the page &amp;quot;after&amp;quot; requirejs has loaded. This provides the optimal page loading speed. If the template is rendered by javascript, the javascript source will be passed to the &amp;quot;done&amp;quot; handler from the promise. Then, when the &amp;quot;done&amp;quot; handler has added the template to the DOM, it can call &lt;br /&gt;
&amp;lt;code javascript&amp;gt;templates.runTemplateJS(javascript);&amp;lt;/code&amp;gt; &lt;br /&gt;
which will create a new script tag and append it to the page head.&lt;br /&gt;
&lt;br /&gt;
== What other helpers can I use? ==&lt;br /&gt;
There is a string helper for loading language strings.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
{{#str}} iscool, mod_cool, David Beckham {{/str}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first 2 words are the string id and the component name, the rest of the section is the content for the $a variable. So this example would call get_string(&#039;iscool&#039;, &#039;mod_cool&#039;, &#039;David Beckham&#039;);&lt;br /&gt;
&lt;br /&gt;
Variables are allowed in the text for the $a param. &lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
{{#str}} iscool, mod_cool, {{name}} {{/str}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For strings that accept complex $a params, you can use a json object here instead:&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
{{#str}} iscool, mod_cool, { firstname: &#039;David&#039;, lastname: &#039;Beckham&#039;}{{/str}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a pix icon helper for generating pix icon tags.&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
{{#pix}} t/edit core Edit David Beckham {{/pix}}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first 2 words are the string id and the component name, the rest is the alt text for the image.&lt;br /&gt;
&lt;br /&gt;
== How do I call a template from php? ==&lt;br /&gt;
&lt;br /&gt;
The templates in php are attached to the renderers. There is a renderer method &amp;quot;render_from_template($templatename, $context)&amp;quot; that does the trick.&lt;br /&gt;
&lt;br /&gt;
== How do templates work with renderers? ==&lt;br /&gt;
&lt;br /&gt;
Extra care must be taken to ensure that the data passed to the context parameter is useful to the templating language. The template language cannot:&lt;br /&gt;
* Call functions&lt;br /&gt;
* Perform any boolean logic&lt;br /&gt;
* Render renderables&lt;br /&gt;
* Do capability checks&lt;br /&gt;
* Make DB queries&lt;br /&gt;
&lt;br /&gt;
So - I have &amp;quot;some&amp;quot; data in my renderable and some logic and html generation in my render method for that renderable - how do I refactor this to use a template?&lt;br /&gt;
&lt;br /&gt;
The first thing to note, is that you don&#039;t have to use a template if you don&#039;t want to. It just means that themers will still have to override your render method, instead of just overriding the template. But if you DO want to use a template, you will earn &amp;quot;cred&amp;quot; with themers, and you will be able to re-render parts of your interface from javascript in response to ajax requests without reloading the whole page (that&#039;s cool).&lt;br /&gt;
&lt;br /&gt;
There is a simple pattern to use to hook a template into a render method. If you make your renderable implement templatable as well as renderable - it will have to implement a new method &amp;quot;export_for_template(renderer_base $output)&amp;quot;. This method takes the data stored in the renderable and &amp;quot;flattens it&amp;quot; so it can be used in a template. If there is some nested data in the renderable (like other renderables) and they do not support templates, they can be &amp;quot;rendered&amp;quot; into the flat data structure using the renderer parameter. It should return an stdClass with properties that are only made of simple types: int, string, bool, float, stdClass or arrays of these types. Then the render method can updated to export the data and render it with the template.&lt;br /&gt;
&lt;br /&gt;
In the renderable:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 /**&lt;br /&gt;
     * Export this data so it can be used as the context for a mustache template.&lt;br /&gt;
     *&lt;br /&gt;
     * @return stdClass&lt;br /&gt;
     */&lt;br /&gt;
    public function export_for_template(renderer_base $output) {&lt;br /&gt;
        $data = new stdClass();&lt;br /&gt;
        $data-&amp;gt;canmanage = $this-&amp;gt;canmanage;&lt;br /&gt;
        $data-&amp;gt;things = array();&lt;br /&gt;
        foreach ($this-&amp;gt;things as $thing) {&lt;br /&gt;
            $data-&amp;gt;things[] = $thing-&amp;gt;to_record();&lt;br /&gt;
        }&lt;br /&gt;
        $data-&amp;gt;navigation = array();&lt;br /&gt;
        foreach ($this-&amp;gt;navigation as $button) {&lt;br /&gt;
            $data-&amp;gt;navigation[] = $output-&amp;gt;render($button);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        return $data;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the renderer class:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    /**&lt;br /&gt;
     * Defer to template.&lt;br /&gt;
     *&lt;br /&gt;
     * @param mywidget $widget&lt;br /&gt;
     *&lt;br /&gt;
     * @return string html for the page&lt;br /&gt;
     */&lt;br /&gt;
    render(mywidget $widget) {&lt;br /&gt;
        $data = $widget-&amp;gt;export_for_template($this);&lt;br /&gt;
        retrn self::render_from_template(&#039;mywidget&#039;, $data);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to I override a template in my theme? ==&lt;br /&gt;
&lt;br /&gt;
Templates can be overridden a bit easier than overriding a renderer. First - find the template that you want to change. E.g. &amp;quot;mod/wiki/templates/ratingui.mustache&amp;quot;. Now, create a sub-folder under your themes &amp;quot;templates&amp;quot; directory with the component name of the plugin you are overriding. E.g &amp;quot;theme/timtam/templates/mod_wiki&amp;quot;. Finally, copy the ratingui.mustache file into the newly created &amp;quot;theme/timtam/templates/mod_wiki&amp;quot; and edit it. You should see your changes immediately if theme designer mode is on. Note: templates are cached just like CSS, so if you are not using theme designer mode you will need to purge all caches to see the latest version of an edited template.&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Timezone_information&amp;diff=47327</id>
		<title>Timezone information</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Timezone_information&amp;diff=47327"/>
		<updated>2015-02-04T05:08:31Z</updated>

		<summary type="html">&lt;p&gt;Jethac: Created page with &amp;quot;Timezone information in Moodle is manually kept up-to-date with the IANA&amp;#039;s Olson database as new information is released. This page contains information on this process.  == G...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Timezone information in Moodle is manually kept up-to-date with the IANA&#039;s Olson database as new information is released. This page contains information on this process.&lt;br /&gt;
&lt;br /&gt;
== Getting new information from the IANA ==&lt;br /&gt;
There are two ways you can get information from the IANA - by downloading the latest release and manually concatenating specific files together, or by running a Python script built for that purpose.&lt;br /&gt;
&lt;br /&gt;
=== Manual retrieval ===&lt;br /&gt;
* Go to [http://www.iana.org/time-zones the IANA&#039;s Time Zone Database site] and get the latest data file (e.g. tzdata*****.tar.gz).&lt;br /&gt;
* Extract the file to an appropriate location.&lt;br /&gt;
* Create a new text file, naming it &#039;&#039;&#039;olson.txt&#039;&#039;&#039; and concatenate the following files in the following order:&lt;br /&gt;
** africa&lt;br /&gt;
** antarctica&lt;br /&gt;
** asia&lt;br /&gt;
** australasia&lt;br /&gt;
** europe&lt;br /&gt;
** northamerica&lt;br /&gt;
** southamerica&lt;br /&gt;
** etcetera&lt;br /&gt;
&lt;br /&gt;
=== Automatic retrieval ===&lt;br /&gt;
* Run the following Python 2.7 script: https://gist.github.com/jethac/ee03aff52176fb7cc9fe&lt;br /&gt;
* Rename the generated .txt file as &#039;&#039;&#039;olson.txt&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Importing information into Moodle ==&lt;br /&gt;
* Place the generated olson.txt file into {dataroot}/temp/olson.txt, where {dataroot} is the path to your Moodle&#039;s moodledata folder&lt;br /&gt;
* In a browser, go to &#039;&#039;&#039;Site administration&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Location&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Update timezones&#039;&#039;&#039; and confirm&lt;br /&gt;
** The contents of your &#039;&#039;&#039;timezone&#039;&#039;&#039; database table will be flushed and regenerated from the olson.txt&lt;br /&gt;
&lt;br /&gt;
== Exporting information ==&lt;br /&gt;
* Using a DB admin tool (e.g. phpMyAdmin, pgadmin3), generate a CSV file from your &#039;&#039;&#039;timezone&#039;&#039;&#039; database table with the following settings:&lt;br /&gt;
** commas as field separators&lt;br /&gt;
** non-quoted values&lt;br /&gt;
** unix line feeds&lt;br /&gt;
** first line as field names&lt;br /&gt;
* Replace {moodleroot}/lib/timezone.txt with the contents of the CSV file&lt;br /&gt;
* Commit to git and fill out the tracker fields as necessary&lt;br /&gt;
&lt;br /&gt;
The integrators have a separate process that copies the {moodleroot}/lib/timezone.txt out of HEAD to https://download.moodle.org/timezone/, so you shouldn&#039;t have to do anything more.&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Theme_upgrade_notes&amp;diff=46990</id>
		<title>Theme upgrade notes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Theme_upgrade_notes&amp;diff=46990"/>
		<updated>2014-12-08T06:09:34Z</updated>

		<summary type="html">&lt;p&gt;Jethac: Created page with &amp;quot;As the project evolves, theme designers and maintainers should take care that their themes accommodate functionality additions and changes.  == Moodle 2.8 == Moodle 2.8 contai...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As the project evolves, theme designers and maintainers should take care that their themes accommodate functionality additions and changes.&lt;br /&gt;
&lt;br /&gt;
== Moodle 2.8 ==&lt;br /&gt;
Moodle 2.8 contains large changes, including but not limited to&lt;br /&gt;
&lt;br /&gt;
* an all-new user menu, and&lt;br /&gt;
* an overhauled gradebook.&lt;br /&gt;
&lt;br /&gt;
These changes bring with them new considerations for theme developers, who will need to adjust their themes accordingly.&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
The user menu is a new renderer function - $OUTPUT-&amp;gt;user_menu() - that leverages the action_menu renderable to create a dropdown menu containing user-centric links (my home, my profile, etc). The user menu encapsulates the same status checks and exposes the same information as the existing $OUTPUT-&amp;gt;login_info() function, with the addition of user pictures.&lt;br /&gt;
&lt;br /&gt;
It is important to note that the user menu depends upon a new function in /user/lib.php, entitled user_get_user_navigation_info. It is possible for the upgrade step to fail if $CFG-&amp;gt;dirroot is overridden by a site&#039;s config.php incorrectly.&lt;br /&gt;
&lt;br /&gt;
==== Including the user menu in a backwards-compatible way ====&lt;br /&gt;
As this is a new feature for 2.8, you may want to build your theme such that it falls back to use $OUTPUT-&amp;gt;login_info if the user menu is not present, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
if (method_exists($OUTPUT, &#039;user_menu&#039;)) {&lt;br /&gt;
  echo $OUTPUT-&amp;gt;user_menu(); // user menu, for Moodle 2.8&lt;br /&gt;
} else {&lt;br /&gt;
  echo $OUTPUT-&amp;gt;login_info(); // login_info, Moodle 2.7 and before&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow you to write a theme that works on both 2.8 and on previous versions of Moodle.&lt;br /&gt;
&lt;br /&gt;
==== Styling edge cases ====&lt;br /&gt;
When styling the user menu, it is important to cover additional use cases under which the user menu changes. These are:&lt;br /&gt;
&lt;br /&gt;
* when Javascript is disabled&lt;br /&gt;
* when a user is &amp;quot;logged in as&amp;quot; another user&lt;br /&gt;
* when a user is using a right-to-left language&lt;br /&gt;
&lt;br /&gt;
Ensure any custom styles you write take into account these circumstances; for reference you may wish to consult the existing styles, which are in /theme/bootstrapbase/less/moodle/modules.less.&lt;br /&gt;
&lt;br /&gt;
=== Grader report ===&lt;br /&gt;
The new grader report is a significant change from its predecessor (please see [https://docs.moodle.org/dev/Grader_report_2014]) and may require some adjustments to your theme.&lt;br /&gt;
&lt;br /&gt;
==== Overflowing ====&lt;br /&gt;
Put simply, the grader report now expects to be directly on the page, overflowing the window bounds if necessary - as the user scrolls more of the table into view, floating row and column headers appear and move with the window to provide context as to their position in the table.&lt;br /&gt;
&lt;br /&gt;
This has unfortunate effects on themes where the grader report is situated within an element with the overflow: hidden rule set, or with a value provided for width or max-width. In order to use the new grader report as designed, allow it to spill out unconstrained - the floating headers will not kick in otherwise and pose a usability concern.&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme&amp;diff=46984</id>
		<title>Creating a theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme&amp;diff=46984"/>
		<updated>2014-12-03T09:24:04Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* The page header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}This document describes how to create a theme for Moodle 2.x.x. It assumes you have some understanding of how themes within Moodle work as well as a good understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
===Theme designer mode===&lt;br /&gt;
&lt;br /&gt;
Under normal operation Moodle does several things in the name of performance, one of these is to combine all of the CSS into one file, minimize it, cache it on the server, and then serve it. After the first request the cached version is served to greatly improve page performance. &lt;br /&gt;
&lt;br /&gt;
What this means for you as a themer? When you make changes they will not be seen immediately. In fact you will need to tell Moodle to rebuild the cache that it is serving.&lt;br /&gt;
This isn&#039;t practical for designing themes of course so the &#039;&#039;&#039;theme designer mode&#039;&#039;&#039; was added. When enabled it tells Moodle not to combine or cache the CSS that gets delivered. This has the downside that page load times will take significantly longer, however you will see your changes immediately every time.&lt;br /&gt;
&lt;br /&gt;
Theme designer mode may be enabled via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; [[Theme settings]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Internet Explorer versions 6 and 7 have BIG problems when a site attempts to link to more than 31 stylesheets, in which case either a limited number or no styles get applied. Because Moodle sends up all of the CSS all of the time with theme designer mode turned on there is a very high chance you will get more than 31 stylesheets being included. This will, of course, cause major problems for Internet Explorer until theme designer mode is turned off.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing you need to do is create the directories and files you will be using, the first thing to create is the actual directory for your theme. This should be the name of your theme, in my case it&#039;s &#039;excitement&#039;. The directory should be located within the theme directory of Moodle, ./moodle/theme/excitement/ will be the directory I create.&lt;br /&gt;
&lt;br /&gt;
Now within that directory we can immediately create several files that we know we are going to need. &lt;br /&gt;
&lt;br /&gt;
So the files that we want to create are:&lt;br /&gt;
; config.php :  All of our settings will go here.&lt;br /&gt;
; /style/ : This directory will contain all of our stylesheets.&lt;br /&gt;
; /style/excitement.css : All of our css will go in here.&lt;br /&gt;
; /pix/ : Into this directory we&#039;ll put a screen shot of our theme as well as our favicon and any images we use in CSS.&lt;br /&gt;
; /layout/ : Our layout files will end up in this directory.&lt;br /&gt;
; /layout/standard.php : This will be our one basic layout file.&lt;br /&gt;
; /lang/en/ : The file we put here will make our theme name show properly on the Theme Selector page. You need a few standard entries. Copy the one from the Standard theme and modify is easiest. &lt;br /&gt;
&lt;br /&gt;
So after this setup step you should have a directory structure similar to what is shown below.&lt;br /&gt;
&lt;br /&gt;
[[image:Learn_to_theme_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Configuring our theme==&lt;br /&gt;
&lt;br /&gt;
Open config.php in your favourite editor and start by adding the opening PHP tags &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;lt;?php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Now we need to add the settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;excitement&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Very simply this tells Moodle the name of your theme, and if you ever have several config.php files open this will help you identify which one you are looking at.&lt;br /&gt;
&lt;br /&gt;
Next, the parents for this theme.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;parents = array(&#039;base&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This tells Moodle that my new theme &#039;&#039;`excitement`&#039; wants to extend the base theme. &lt;br /&gt;
&lt;br /&gt;
A theme can extend any number of themes. Rather than creating an entirely new theme and copying all of the CSS, you can simply create a new theme, extend the theme you like and just add the changes you want to your theme. &lt;br /&gt;
&lt;br /&gt;
Also worth noting is the purpose of the base theme: it provides us with a basic layout and just enough CSS to make everything fall into place.&lt;br /&gt;
&lt;br /&gt;
Now we will tell Moodle about our stylesheets:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&#039;excitement&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final thing we need to add into our theme&#039;s config.php file is the definition of the layouts for our theme:&lt;br /&gt;
(in the code below, replace &#039;general.php&#039; with &#039;standard.php&#039; because that is the file that is previously created)&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts = array(&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;general.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&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;general.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.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;general.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, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nologininfo&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#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;general.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;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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, and it is good idea if it does not have links to&lt;br /&gt;
    // other places - for example there should not be a home link in the footer...&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;noblocks&#039;=&amp;gt;true, &#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;noblocks&#039;=&amp;gt;true, &#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;false, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;report.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nologinlinks&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/** List of javascript files that need to be included on each page */&lt;br /&gt;
$THEME-&amp;gt;javascripts = array();&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you are looking at is the different layouts for our theme. Why are there so many? Because, that is how many there are in Moodle. There is one for every general type of page. With my &#039;&#039;`excitement`&#039;&#039; theme I have chosen to use my own layout. Unless there was a specific reason to do so, normally you would not need to create your own layouts, you could extend the base theme, and use its layouts, meaning you would only have to write CSS to achieve your desired look.&lt;br /&gt;
&lt;br /&gt;
For each layout above, you will notice the following four things are being set:&lt;br /&gt;
; file : This is the name of the layout file we want to use, it should always be located in the above themes layout directory. For us this is of course standard.php as we only have one layout file.&lt;br /&gt;
; regions : This is an array of block regions that our theme has. Each entry in here can be used to put blocks in when that layout is being used.&lt;br /&gt;
; defaultregion : If a layout has regions it should have a default region, this is where blocks get put when first added. It is also where the &amp;quot;add block&amp;quot; block is shown when editing is on.&lt;br /&gt;
; options : These are special settings, anything that gets put into the options array is available later on when we are writing our layout file.&lt;br /&gt;
&lt;br /&gt;
There are additional settings that can be defined in the config.php file - see [[Themes 2.0|Themes 2.0]] for the full list.&lt;br /&gt;
&lt;br /&gt;
==Configuring the language file==&lt;br /&gt;
Open theme_base.php file from &#039;&#039;&#039;base/lang/en/theme_base.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Save it as &#039;&#039;&#039;excitement/lang/en/theme_excitement.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Change &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Base&#039;; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Excitement&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After making these changes and perhaps clearing theme caches and/or purging all caches, the new theme name should now show properly in the Theme Selector: &#039;&#039;Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme Selector&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can also edit the theme description:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Write your theme description here.&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to leave the following two lines in place (you can change the wording if you need to) to avoid notices when editing blocks etc.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Writing the layout file==&lt;br /&gt;
&lt;br /&gt;
The excitement theme has just one layout file.&lt;br /&gt;
&lt;br /&gt;
The downside of this is that I have to make the layout file do everything I want which means I need to make use of some options (as defined in the layouts in config.php). &lt;br /&gt;
&lt;br /&gt;
The upside is that I only need to maintain one file. &lt;br /&gt;
&lt;br /&gt;
Other than maintenance, using multiple layout files provides many advantages to real world themes in that you can easily tweak and customise specific layouts to achieve the goals of the organisation using the theme.&lt;br /&gt;
&lt;br /&gt;
Before learning more it is good to understand the two primary objects that will be used in your layout files: $OUTPUT and $PAGE.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$OUTPUT&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;core_renderer&amp;lt;/code&amp;gt; class which is defined in lib/outputrenderers.php. Each method is clearly documented there, along with which is appropriate for use within the layout files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$PAGE&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;moodle_page&amp;lt;/code&amp;gt; class defined in lib/pagelib.php. Most of the things you will want to use are the properties that are all documented at the top of the file. If you are not familiar with PHP properties, you access them like $PAGE-&amp;gt;activityname, just like fields of an ordinary PHP object. (However, behind the scenes the value you get is produced by calling a function. Also, you cannot change these values, they are &#039;&#039;&#039;read-only&#039;&#039;&#039;. However, you don&#039;t need to understand all that if you are just using these properties in your theme.)&lt;br /&gt;
&lt;br /&gt;
So lets start writing standard.php, the layout file for my &#039;&#039;`excitement`&#039;&#039; theme.&lt;br /&gt;
&lt;br /&gt;
===The top of the layout file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$hassidepre = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-pre&#039;, $OUTPUT);&lt;br /&gt;
$hassidepost = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-post&#039;, $OUTPUT);&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype(); ?&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the code that goes into this section:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is very important and is required to go at the very top of the page. This tells Moodle to print out the document type tag that is determined by the settings within Moodle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we open the HTML tag and then ask Moodle to print the attributes that should go inside it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Simply creates the title tag and asks Moodle to fill it in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are asking Moodle to print all of the other tags and content that need to go into the head. This includes stylesheets, script tags, and inline JavaScript code.&lt;br /&gt;
&lt;br /&gt;
===The page header===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
                if (method_exists($OUTPUT, &#039;user_menu&#039;)) {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;user_menu(); // user menu, for Moodle 2.8&lt;br /&gt;
                } else {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;login_info(); // login_info, Moodle 2.7 and before&lt;br /&gt;
                }&lt;br /&gt;
                if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
                    echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
                }&lt;br /&gt;
                echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
            ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
        &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So there is a bit more going on here obviously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again much like what we did for the opening HTML tag in the head we have started writing the opening body tag and are then asking Moodle to give us the ID we should use for the body tag as well as the classes we should use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This very important call writes some critical bits of JavaScript into the page. It should always be located after the body tag as soon as possible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
......&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are checking whether or not we need to print the header for the page. There are three checks we need to make here:&lt;br /&gt;
# &#039;&#039;&#039;$PAGE-&amp;gt;heading&#039;&#039;&#039; : This checks to make sure that there is a heading for the page. This will have been set by the script and normally describes the page in a couple of words.&lt;br /&gt;
# &#039;&#039;&#039;empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;])&#039;&#039;&#039; : Now this check is looking at the layout options that we set in our config.php file. It is looking to see if the layout set &#039;nonavbar&#039; =&amp;gt; true.&lt;br /&gt;
# &#039;&#039;&#039;$PAGE-&amp;gt;has_navbar()&#039;&#039;&#039; The third check is to check with the page whether it has a navigation bar to display.&lt;br /&gt;
If either there is a heading for this page or there is a navigation bar to display then we will display a heading.&lt;br /&gt;
&lt;br /&gt;
Leading on from this lets assume that there is a header to print.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
    .....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line is simply saying if the page has a heading print it. In this case we run the first check above again just to make sure there is a heading, we then open a heading tag that we choose and ask the page to print the heading.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
    if (method_exists($OUTPUT, &#039;user_menu&#039;)) {&lt;br /&gt;
      echo $OUTPUT-&amp;gt;user_menu(); // user menu, for Moodle 2.8&lt;br /&gt;
    } else {&lt;br /&gt;
      echo $OUTPUT-&amp;gt;login_info(); // login_info, Moodle 2.7 and before&lt;br /&gt;
    }&lt;br /&gt;
    if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
        echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
    }&lt;br /&gt;
    echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are looking to print the menu and content that you see at the top of the page (usually to the right). We start by getting Moodle to print the login information for the current user. If the user is logged in this will be their name and a link to their profile, if not then it will be a link to login. Note that on Moodle 2.8 and above, a new user menu renderable is available that visually shows the same information as the login info renderable, as well as a dropdown menu with user-centric actions.&lt;br /&gt;
&lt;br /&gt;
Next we check our page options to see whether a language menu should be printed. If in the layout definition within config.php it sets &#039;&#039;&#039;langmenu =&amp;gt; true&#039;&#039;&#039; then we will print the language menu, a drop down box that lets the user change the language that Moodle displays in.&lt;br /&gt;
&lt;br /&gt;
Finally the page also has a heading menu that can be printed. This heading menu is special HTML that the page you are viewing wants to add. It can be anything from drop down boxes to buttons and any number of each.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The final part of the header.&lt;br /&gt;
&lt;br /&gt;
Here we want to print the navigation bar for the page if there is one. To find out if there is one we run checks number 2 and 3 again and proceed if they pass.&lt;br /&gt;
&lt;br /&gt;
Assuming there is a header then there are two things that we need to print. The first is the navigation bar. This is a component that the OUTPUT library knows about. The second is a button to show on the page.&lt;br /&gt;
&lt;br /&gt;
In both cases we choose to wrap them in a div tag with a class attribute to enable theming on those elements.&lt;br /&gt;
&lt;br /&gt;
Well that is it for the header. There is a lot of PHP compared to the other sections of the layout file but it does not change and can be copied and pasted between themes.&lt;br /&gt;
&lt;br /&gt;
===The page content===&lt;br /&gt;
&lt;br /&gt;
I am going with the default two block regions plus the main content.&lt;br /&gt;
&lt;br /&gt;
Because I have based this theme and layout file on the base theme the HTML looks a little intense. This is because it is a floating div layout where the content comes first and then we get the columns (even though one column will be to the left of the content.) Don&#039;t worry too much about it. When it comes to writing your own theme you can go about it as you choose.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page-content&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;region-main-box&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;region-post-box&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;div id=&amp;quot;region-main-wrap&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-main&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&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;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-pre&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
                &lt;br /&gt;
                &amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-post&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;?php } ?&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;
In regards to PHP this section is very easy. There are only three lines for the whole section one to get the main content and one for each block region.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line prints the main content for the page.&lt;br /&gt;
PLEASE NOTE: In Moodle 2.2 onwards &amp;quot;core_renderer::MAIN_CONTENT_TOKEN&amp;quot; changed to &amp;quot;$OUTPUT-&amp;gt;main_content()&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
These lines of code check the variables we created earlier on to decide whether we should show the pre block region. If you try to display a block region that isn&#039;t there or has no content then Moodle will give you an error message so these lines are very important.&lt;br /&gt;
&lt;br /&gt;
For those who get an error message if it is &amp;quot;unknown block region side-pre&amp;quot; or &amp;quot;unknown block region side-post&amp;quot; then this is the issue you are experiencing. Simply add the following lines and all will be fine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line gets all of the blocks and more particularly the content for the block region &#039;&#039;&#039;side-pre&#039;&#039;&#039;. This block region will be displayed to the left of the content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again we should make this check for every block region as there are some pages that have no blocks what-so-ever.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are getting the other block region &#039;&#039;&#039;side-post&#039;&#039;&#039; which will be displayed to the right of the content.&lt;br /&gt;
&lt;br /&gt;
===The page footer===&lt;br /&gt;
Here we want to print the footer for the page, any content required by Moodle, and then close the last tags.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html() ?&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;
The section of code is responsible for printing the footer for the page.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first thing we do before printing the footer is check that we actually want to print it. This is done by checking the options for the layout as defined in the config.php file. If &#039;&#039;&#039;nofooter =&amp;gt; true&#039;&#039;&#039; is set the we don&#039;t want to print the footer and should skip over this body of code.&lt;br /&gt;
&lt;br /&gt;
Assuming we want to print a footer we proceed to create a div to house its content and then print the bits of the content that will make it up.&lt;br /&gt;
There are four things that the typical page footer will want to print:&lt;br /&gt;
; echo page_doc_link(get_string(&#039;moodledocslink&#039;)) : This will print a link to the Moodle.org help page for this particular page.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;login_info(); : This is the same as at the top of the page and will print the login information for the current user.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;home_link(); : This prints a link back to the Moodle home page for this site.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;standard_footer_html(); : This prints special HTML that is determined by the settings for the site. Things such as performance information or debugging will be printed by this line if they are turned on.&lt;br /&gt;
&lt;br /&gt;
And the final line of code for our layout file is:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is one of the most important lines of code in the layout file. It asks Moodle to print any required content into the page, and there will likely be a lot although most of it will not be visual.&lt;br /&gt;
&lt;br /&gt;
It will instead be things such as inline scripts and JavaScript files required to go at the bottom of the page. If you forget this line its likely no JavaScript will work!&lt;br /&gt;
&lt;br /&gt;
We&#039;ve now written our layout file and it is all set to go. The complete source is below for reference. Remember if you want more practical examples simply look at the layout files located within the layout directory of other themes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$hassidepre = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-pre&#039;, $OUTPUT);&lt;br /&gt;
$hassidepost = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-post&#039;, $OUTPUT);&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype() ?&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title; ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;favicon&#039;, &#039;theme&#039;)?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
        &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
            echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
            if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
                echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
            }&lt;br /&gt;
            echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
        ?&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
        &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-content&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;region-main-box&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;div id=&amp;quot;region-post-box&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-main-wrap&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div id=&amp;quot;region-main&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                            &amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&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;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-pre&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
                &lt;br /&gt;
                &amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-post&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&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;
&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html() ?&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;
==Adding some CSS==&lt;br /&gt;
With config.php and standard.php both complete the theme is now usable and starting to look like a real theme, however if you change to it using the theme selector you will notice that it still lacks any style.&lt;br /&gt;
&lt;br /&gt;
This of course is where CSS comes in. When writing code Moodle developers are strongly encouraged to not use inline styles anywhere. This is fantastic for us as themers because there is nothing (or at least very little) in Moodle that cannot be styled using CSS.&lt;br /&gt;
&lt;br /&gt;
===Moodle CSS basics===&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.0 all of the CSS for the whole of Moodle is delivered all of the time! This was done for performance reasons. Moodle now reads in all of the CSS, combines it into one file, shrinks it removing any white space, caches it, and then delivers it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What this means for you as a themer?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You will need to write good CSS that won&#039;t clash with any other CSS within Moodle.&lt;br /&gt;
&lt;br /&gt;
Moodle is so big and complex,there is no way to ensure that classes don&#039;t get reused. What we can control however is the classes and id that get added to the body tag for every page. When writing CSS it is highly encouraged to make full use of these body classes, using them will help ensure the CSS you write has the least chance of causing conflicts.&lt;br /&gt;
&lt;br /&gt;
You should also take the time to look at how the Moodle themes use CSS. Look at their use of the body classes and how they separate the CSS for the theme into separate files based on the region of Moodle it applies to.&lt;br /&gt;
&lt;br /&gt;
Check out [[Themes 2.0|Themes 2.0]] and [[CSS coding style]] for more information about writing good CSS.&lt;br /&gt;
&lt;br /&gt;
===Starting to write excitement.css===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
a {&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.addcoursebutton .singlebutton {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1.headermain {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.main {&lt;br /&gt;
    border-bottom: 3px solid #013D6A;&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock {&lt;br /&gt;
    font-size: 18pt;&lt;br /&gt;
    margin-top: 0;&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header {&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header .headermenu {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header .headermenu a {&lt;br /&gt;
    color: #FDFF2A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar {&lt;br /&gt;
    padding-left: 1em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.breadcrumb li {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.breadcrumb li a {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block {&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .header .title {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .header .title .block_action input {&lt;br /&gt;
    background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .content {&lt;br /&gt;
    border: 1px solid #000;&lt;br /&gt;
    padding: 5px;&lt;br /&gt;
    background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .content .block_tree p {&lt;br /&gt;
    font-size: 80%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform {&lt;br /&gt;
    margin-left: 5%;&lt;br /&gt;
    width: 90%;&lt;br /&gt;
    font-size: 9pt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform #adminsearchquery {&lt;br /&gt;
    width: 95%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .calendar-controls a {&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
    font-weight: bold;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar td {&lt;br /&gt;
    border-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .day a {&lt;br /&gt;
    color: #FFF000;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays th {&lt;br /&gt;
    border-width: 0;&lt;br /&gt;
    font-weight: bold;&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays abbr {&lt;br /&gt;
    border-width: 0;&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
[[image:Learn_to_theme_02.jpg|400px|thumb|Excitement theme screenshot]]&lt;br /&gt;
This isn&#039;t all of the CSS for the theme, but just enough to style the front page when the user is not logged in.&lt;br /&gt;
Remember this theme extends the base theme so there is already CSS for layout as well.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* The CSS is laid out in a single line format. This is done within the core themes for Moodle. It makes it quicker to read the selectors and see what is being styled.&lt;br /&gt;
* I have written my selectors to take into account the structure of the HTML (more than just the one tag I want to style). This helps further to reduce the conflicts that I may encounter.&lt;br /&gt;
* I use generic classes like &#039;&#039;.sideblock&#039;&#039; only where I want to be generic, as soon as I want to be specific I use the unique classes such as &#039;&#039;.block_calendar_month&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using images within CSS===&lt;br /&gt;
&lt;br /&gt;
I will add two image files to the pix directory of my theme:&lt;br /&gt;
; /theme/excitement/pix/background.png : This will be the background image for my theme.&lt;br /&gt;
; /theme/excitement/pix/gradient.jpg : This will be a gradient I use for the header and headings.&lt;br /&gt;
I quickly created both of these images using gimp and simply saved them to the pix directory.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
html {&lt;br /&gt;
    background-image: url([[pix:theme|background]]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock,&lt;br /&gt;
#page-header,&lt;br /&gt;
.sideblock,&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {&lt;br /&gt;
    background-image: url([[pix:theme|gradient]]);&lt;br /&gt;
    background-repeat: repeat-x;&lt;br /&gt;
    background-color: #0273C8;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
[[image:Learn_to_theme_03.jpg‎|400px|thumb|Excitement theme screenshot]]&lt;br /&gt;
The CSS above is the two new rules that I had to write to use my images within CSS.&lt;br /&gt;
&lt;br /&gt;
The first rule sets the background image for the page to background.png&lt;br /&gt;
&lt;br /&gt;
The second rule sets the background for headings, and the sideblocks to use gradient.jpg&lt;br /&gt;
&lt;br /&gt;
You will notice that I did not need to write a path to the image. This is because Moodle has this special syntax that can be used and will be replaced when the CSS is parsed before delivery.&lt;br /&gt;
The advantage of using this syntax over writing the path in is that the path may change depending on where you are or what theme is being used.&lt;br /&gt;
&lt;br /&gt;
Other themers may choose to extend your theme with their own; if you use this syntax then all they need to do to override the image is to create one with the same name in their themes directory.&lt;br /&gt;
&lt;br /&gt;
You will also notice that I don&#039;t need to add the image files extension. This is because Moodle is smart enough to work out what extension the file uses. It also allows themers to override images with different formats.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot; /&amp;gt;&lt;br /&gt;
The following is the complete CSS for my theme:&lt;br /&gt;
&amp;lt;div style=&amp;quot;overflow:auto;height:860px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
a {text-decoration: none;}&lt;br /&gt;
.addcoursebutton .singlebutton {text-align: center;}&lt;br /&gt;
&lt;br /&gt;
h1.headermain {color: #fff;}&lt;br /&gt;
h2.main {border-bottom: 3px solid #013D6A;color: #013D6A;text-align: center;}&lt;br /&gt;
h2.headingblock {font-size: 18pt;margin-top: 0;background-color: #013D6A;color: #FFF;text-align: center;}&lt;br /&gt;
#page-header {background-color: #013D6A;border-bottom:5px solid #013D6A;}&lt;br /&gt;
#page-header .headermenu  {color: #FFF;}&lt;br /&gt;
#page-header .headermenu a {color: #FDFF2A;}&lt;br /&gt;
&lt;br /&gt;
.sideblock {background-color: #013D6A;}&lt;br /&gt;
.sideblock .header .title {color: #FFF;}&lt;br /&gt;
.sideblock .header .title .block_action input {background-color: #FFF;}&lt;br /&gt;
.sideblock .content {border: 1px solid #000;padding: 5px;background-color: #FFF;}&lt;br /&gt;
.sideblock .content .block_tree p {font-size: 80%;}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer {text-align: center;}&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform {margin-left: 5%;width: 90%;font-size: 9pt;}&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform #adminsearchquery {width: 95%;}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .calendar-controls a {color: #013D6A;font-weight: bold;}&lt;br /&gt;
.block_calendar_month .content .minicalendar td {border-color: #FFF;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {color: #FFF;background-color: #013D6A;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .day a {color: #FFF000;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays th {border-width: 0;font-weight: bold;color: #013D6A;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays abbr {border-width: 0;text-decoration: none;}&lt;br /&gt;
&lt;br /&gt;
html {background-image:url([[pix:theme|background]]);}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock,&lt;br /&gt;
#page-header,&lt;br /&gt;
.sideblock,&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {background-image:url([[pix:theme|gradient]]);&lt;br /&gt;
   background-repeat:repeat-x;background-color: #0273C8;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding a screenshot and favicon==&lt;br /&gt;
The final thing to do at this point is add both a screenshot for this theme as well as a favicon for it.&lt;br /&gt;
The screenshot will be shown in the theme selector screen and should be named &#039;&#039;screenshot.jpg&#039;&#039;.&lt;br /&gt;
The favicon will be used when someone bookmarks this page.&lt;br /&gt;
Both images should be located in your themes pix directory as follows:&lt;br /&gt;
* /theme/excitement/pix/screenshot.jpg&lt;br /&gt;
* /theme/excitement/pix/favicon.ico&lt;br /&gt;
&lt;br /&gt;
In the case of my theme I have taken a screenshot and added it to that directory, and because I don&#039;t really want to do anything special with the favicon I have copied it from /theme/base/pix/favicon.ico so that at least it will be recognisable as Moodle.&lt;br /&gt;
&lt;br /&gt;
[[es:Desarollo:Temas 2.0 creando tu primer tema]]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Themes_overview&amp;diff=46983</id>
		<title>Themes overview</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Themes_overview&amp;diff=46983"/>
		<updated>2014-12-03T09:20:50Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* Layout files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}Welcome to the new world of themes in Moodle 2.x!&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 2.0&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;
&lt;br /&gt;
==What&#039;s new in 2.7==&lt;br /&gt;
{{Moodle 2.7}}&lt;br /&gt;
&lt;br /&gt;
===Compiling LESS===&lt;br /&gt;
&lt;br /&gt;
Themes now have the ability to compile a LESS file on the fly. This was intended to be used for dynamic injection of LESS code or variables. (MDL-44357)&lt;br /&gt;
&lt;br /&gt;
==What&#039;s new in 2.6==&lt;br /&gt;
{{Moodle 2.6}}&lt;br /&gt;
&lt;br /&gt;
===Fonts===&lt;br /&gt;
&lt;br /&gt;
CSS3 fonts can be now used in plugins, core and moodle themes. It is very similar to images in pix subdirectories (MDL-23493).&lt;br /&gt;
&lt;br /&gt;
===Chat Activity===&lt;br /&gt;
&lt;br /&gt;
The Chat room window is now also styled via bootstrapbase. Themes based on bootstrapbase can now directly style or use &#039;customcss&#039; to style the chat window now. (MDL-42711)&lt;br /&gt;
&lt;br /&gt;
==What&#039;s new in 2.5==&lt;br /&gt;
{{Moodle 2.5}}&lt;br /&gt;
&lt;br /&gt;
There is a new Bootstrap base theme. See [[Clean theme]] for more information.&lt;br /&gt;
&lt;br /&gt;
==What&#039;s new in 2.4==&lt;br /&gt;
{{Moodle 2.4}}&lt;br /&gt;
&lt;br /&gt;
===HTML 5 doctype===&lt;br /&gt;
&lt;br /&gt;
By default Moodle is sending HTML5 doctype. Themes designers may decide to force old xhtml strict mode, but it is strongly discouraged and the site will not pass strictness validation. (MDL-34299)&lt;br /&gt;
&lt;br /&gt;
===Internet Explorer standards mode===&lt;br /&gt;
&lt;br /&gt;
Since 2.4 Moodle automatically sends X-UA-Compatible edge header, this should prevent Internet Explorer from switching to quirks or compatibility modes (MDL-36524). There is also a new workaround for intranet servers which previously identified recent IE browsers as IE7. (MDL-36481)&lt;br /&gt;
&lt;br /&gt;
===SVG icons===&lt;br /&gt;
&lt;br /&gt;
Most modern browsers support SVG icons. The benefit is that SVG scales perfectly to any screen resolution or zoom. It is now possible to add icons in SVG format to pix directories, Moodle uses SVG in supported browsers and PNG in legacy browsers. (MDL-22955)&lt;br /&gt;
&lt;br /&gt;
Please note that IE9 does not handle scaling of standard SVG icons properly, you may have to manually execute a special script from theme/base/cli/svgtool.php to alter the icons to be compatible with buggy IE9. (MDL-36436)&lt;br /&gt;
&lt;br /&gt;
==What&#039;s new in 2.0==&lt;br /&gt;
&lt;br /&gt;
The theme system was completely redesigned in Moodle 2.0.  Known issues have been addressed and new features have been added to meet community requests.&lt;br /&gt;
&lt;br /&gt;
Unfortunately it was not possible to maintain backward compatibility, so all Moodle 1.x themes need to be recreated for Moodle 2.0.&lt;br /&gt;
&lt;br /&gt;
Major changes include:&lt;br /&gt;
* Clearer and more consistent CSS classes and IDs throughout all pages in Moodle&lt;br /&gt;
* Introduction of layout files (templates) describing overall layout HTML for many different types of pages in Moodle.&lt;br /&gt;
* Introduction of renderers, which produce the smaller &amp;quot;parts&amp;quot; of a HTML page.  Advanced themes can choose to override these too if they choose.&lt;br /&gt;
* Introduction of standard methods for adding Javascript to themes.&lt;br /&gt;
* Easier control over icons and images in Moodle.&lt;br /&gt;
* The old &amp;quot;standard&amp;quot; theme has been split into two themes:&lt;br /&gt;
**&#039;&#039;&#039;base&#039;&#039;&#039; - contains absolutely basic layout, and&lt;br /&gt;
**&#039;&#039;&#039;standard&#039;&#039;&#039; - which adds CSS to the base theme to make it look like the old standard theme.&lt;br /&gt;
* Performance tuning: In normal production mode CSS files are combined into a single optimised file, and both CSS and JavaScript files are minimised to ensure there are no wasted connections or traffic.  Files are heavily cached, but also versioned, so that users never need to clear their caches.&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. (If you know Moodle 1.9, it&#039;s like a combination of header.html and footer.html).&lt;br /&gt;
# &#039;&#039;&#039;The base theme&#039;&#039;&#039; - is not intended to be used for production sites.  It sets up the simplest possible generic layout and includes only CSS essential to that layout &#039;&#039;or&#039;&#039; to Moodle as a whole.  It tries not to make any unnecessary rules and makes as few assumptions as possible.  It&#039;s the perfect base on which to start designing a theme, as there are very few colours, borders, margins, and alignments to override.  You can just start adding what you need.&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 classes and functions that are used by theme&lt;br /&gt;
|-&lt;br /&gt;
| /&lt;br /&gt;
| renderers.php &lt;br /&gt;
| Contains any custom renderers for the theme.&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 the theme user 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;
| /javascript/ &lt;br /&gt;
| *.js&lt;br /&gt;
| All specialty JavaScript files the theme requires should be located in here.&lt;br /&gt;
|-&lt;br /&gt;
| /lang/ &lt;br /&gt;
| &lt;br /&gt;
| Any special language files the theme requires should be located in here.&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;
&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;
==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 a basic theme configuration file and the different bits that make it up:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;newtheme&#039;;&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;parents = array(&lt;br /&gt;
    &#039;base&#039;&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&lt;br /&gt;
    &#039;admin&#039;,&lt;br /&gt;
    &#039;blocks&#039;,&lt;br /&gt;
    &#039;calendar&#039;,&lt;br /&gt;
    &#039;course&#039;,&lt;br /&gt;
    &#039;grade&#039;,&lt;br /&gt;
    &#039;message&#039;,&lt;br /&gt;
    &#039;question&#039;,&lt;br /&gt;
    &#039;user&#039;&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;layouts = array(&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;newtheme&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;newtheme&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    )&lt;br /&gt;
    //.......&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array(&lt;br /&gt;
    &#039;navigation&#039;&lt;br /&gt;
);&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;parents : This defines the themes that the theme will extend. In this case it is extending only the base theme.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;sheets : An array containing the names of the CSS stylesheets to include for this theme. 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;layouts : In this example, two layouts have been defined to override the layouts from the base theme. For more information see the [[#Layouts|layouts]] section below.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;javascripts_footer : The final setting is to include a JavaScript file. Much like stylesheets, you only need to provide the files name. Moodle will assume it is in your themes JavaScript directory and be a .js file.&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.&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;
&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 within the themes provided in the standard install by Moodle there is a very clear organisation of CSS.&lt;br /&gt;
&lt;br /&gt;
First is the  pagelayout.css file. This contains the CSS required to give the layouts their look and feel.  It doesn&#039;t contain any rules that affect the content generated by Moodle.&lt;br /&gt;
&lt;br /&gt;
Next is the core.css file. If you open up core you will notice that it contains all manner of general (usually simple) rules that don&#039;t relate to a specific section of Moodle but to Moodle as a whole.&lt;br /&gt;
&lt;br /&gt;
There can also be rules that relate to specific sections.  However, this is done only when there are only a handful of rules for that section. These small clusters of rules are grouped together and separated by comments identifying for which section each relates.&lt;br /&gt;
&lt;br /&gt;
Finally there are all the other CSS files, you will notice that there is a file for each section of Moodle that has a significant collection of rules.&lt;br /&gt;
&lt;br /&gt;
:For those who are familiar with Moodle 1.9 theme&#039;s, this organisation will be a big change. In 1.9, CSS was organised by its nature (for example: colours, layout, other).&lt;br /&gt;
&lt;br /&gt;
===How to write effective CSS rules within Moodle===&lt;br /&gt;
In Moodle 2.0, 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;
As of Moodle 2.0 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;
&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 html4strict&amp;gt;&amp;lt;body id=”page-mod-forum-view” class=”path-mod path-mod-forum” /&amp;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;
==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. The standard theme in Moodle is a good example of this as it extends the base theme simply adding CSS to achieve its look and feel.&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;base&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#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 base theme. If you take a look first at theme/base/config.php you will notice that several layouts specify options &#039;&#039;&#039;nonavbar&#039;&#039;&#039; and &#039;&#039;&#039;nofooter&#039;&#039;&#039; which can both be set to either true or false. Then if we take a look at theme/base/layout/general.php you will spot lines like the following:&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;
............&lt;br /&gt;
&amp;lt;?php if ($hasnavbar) { ?&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
What you are seeing here is the use of those settings from the layout within the layout file. In this case it is being used to toggle the display of the navigation bar and page footer.&lt;br /&gt;
&lt;br /&gt;
==Layout files==&lt;br /&gt;
A layout file is a file that contains the core HTML structure for a layout including the header, footer, content and block regions. For those of you who are familiar with themes in Moodle 1.9 this is simply header.html and footer.html combined. Of course it is not all HTML, there are bits of HTML and content that Moodle needs to put into the page, within each layout file this will be done by a couple of simple PHP calls to get bits and pieces including content.&lt;br /&gt;
&lt;br /&gt;
Before learning more it is good to understand the two primary objects that will be used in your layout files: $OUTPUT and $PAGE.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$OUTPUT&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;core_renderer&amp;lt;/code&amp;gt; class which is defined in lib/outputrenderers.php. Each method is clearly documented there, along with which is appropriate for use within the layout files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$PAGE&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;moodle_page&amp;lt;/code&amp;gt; class defined in lib/pagelib.php. Most of the things you will want to use are the properties that are all documented at the top of the file. If you are not familiar with PHP properties, you access them like $PAGE-&amp;gt;activityname, just like fields of an ordinary PHP object. (However, behind the scenes the value you get is produced by calling a function. Also, you cannot change these values, they are &#039;&#039;&#039;read-only&#039;&#039;&#039;. However, you don&#039;t need to understand all that if you are just using these properties in your theme.)&lt;br /&gt;
&lt;br /&gt;
The following is a very simple layout file to illustrate the different bits that make it up:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;doctype() ?&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid) ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses) ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td colspan=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
                if (method_exists($OUTPUT, &#039;user_menu&#039;)) {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;user_menu(); // user menu, for Moodle 2.8&lt;br /&gt;
                } else {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;login_info(); // login_info, Moodle 2.7 and before&lt;br /&gt;
                }&lt;br /&gt;
                echo $PAGE-&amp;gt;headingmenu;&lt;br /&gt;
              ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td colspan=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
            &amp;lt;?php&lt;br /&gt;
            echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
            echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
            echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
            ?&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html() ?&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 assume you know enough HTML to understand the basic structure above, but let&#039;s explain the PHP code since that is less obvious.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;doctype() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This occurs at the VERY top of the page, it must be the first bit of output and is responsible for adding the (X)HTML document type definition to the page. This of course is determined by the settings of the site and is one of the things that the theme designer has no control over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we have started writing the opening html tag and have asked Moodle to give us the HTML attributes that should be applied to it. This again is determined by several settings within the actual HTML install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This gets us the title for the page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This very important call gets us the standard head HTML that needs to be within the HEAD tag of the page. This is where CSS and JavaScript requirements for the top of the page will be output as well as any special script or style tags.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Much like the html tag above we have started writing the body tag and have asked for Moodle to get us the desired ID and classes that should be applied to it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
if (method_exists($OUTPUT, &#039;user_menu&#039;)) {&lt;br /&gt;
  echo $OUTPUT-&amp;gt;user_menu(); // user menu, for Moodle 2.8 onwards&lt;br /&gt;
} else {&lt;br /&gt;
  echo $OUTPUT-&amp;gt;login_info(); // login_info, Moodle 2.7 and before&lt;br /&gt;
}&lt;br /&gt;
echo $PAGE-&amp;gt;headingmenu; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are creating the header for the page. In this case we want the heading for the page, a user menu (for Moodle 2.8+) or login information (the current users username or a link to log in if they are not logged in), and we want the heading menu if there is one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we get the HTML to display the blocks that have been added to the page. In this case we have asked for all blocks that have been added to the area labelled &#039;&#039;side-pre&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is one of the most important calls within the file, it determines where the actual content for the page gets inserted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we get the HTML to display the blocks that have been added to the page. In this case we have asked for all blocks that have been added to the area labelled &#039;&#039;side-post&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This final bit of code gets the content for the footer of the page. It gets the login information which is the same as in the header, a home link, and the standard footer HTML which like the standard head HTML contains all of the script and style tags required by the page and requested to go in the footer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;&#039;&#039;: Within Moodle 2.0 most of the JavaScript for the page will be included in the footer. This greatly helps reduce the loading time of the page.&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;standard&#039; theme has a language file called lang/en/theme_standard.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 standard theme, adapt as required):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Standard&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;This theme is a very basic white theme, with a minimum amount of &lt;br /&gt;
 CSS added to the base theme to make it actually usable.&#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 HTML, such as if you wanted to use them within a layout file.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;imageone&#039;, &#039;theme&#039;);?&amp;gt;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt; &lt;br /&gt;
&amp;lt;img src=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;subdir/imagetwo&#039;, &#039;theme&#039;);?&amp;gt;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&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;
In this case rather than writing out the URL to the image we use a method of Moodle&#039;s output library. 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;
&lt;br /&gt;
The following is how you would use the images from within CSS as background images.&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;
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 module images we need a &#039;&#039;&#039;pix_mod&#039;&#039;&#039; directory.&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;
==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;base&#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;
==Appendix A==&lt;br /&gt;
===Theme options as of 8th April 2014===&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.&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;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 within the body of the 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;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;filter_mediaplugin_colors&#039;&#039;&#039;&lt;br /&gt;
|  Used to control the colours used in the small media player for the filters&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)&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.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;larrow&#039;&#039;&#039;&lt;br /&gt;
|  Overrides the left arrow image used throughout Moodle&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;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;rarrow&#039;&#039;&#039;&lt;br /&gt;
|  Overrides the right arrow image used throughout Moodle&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.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;resource_mp3player_colors&#039;&#039;&#039;&lt;br /&gt;
|  Controls the colours for the MP3 player&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.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;supportscssoptimisation&#039;&#039;&#039;&lt;br /&gt;
|  When set to &#039;FALSE&#039; then the theme will not be affected by the &#039;CSS Optimiser&#039;.  The &#039;CSS Optimiser&#039; is enabled in Development &amp;gt; Experimental &amp;gt; Experimental settings.  When it is enabled CSS will be run through an optimisation process before being cached. The optimiser processes the CSS removing duplicate rules and styles, as well as white space removable and reformatting. Please note turning this on at the same time as theme designer mode is awful for performance but will help theme designers create optimised CSS.&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.&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;
* [[Theme changes in 2.0]]&lt;br /&gt;
* [[Adding courses and categories to the custom menu]] &lt;br /&gt;
* [[Making a horizontal dock]]&lt;br /&gt;
* [[Adding theme upgrade code]]&lt;br /&gt;
* [[Styling and customising the dock]] &lt;br /&gt;
* [[Changing topic or weekly outline to Page heading]]&lt;br /&gt;
* [[jQuery]]&lt;br /&gt;
&lt;br /&gt;
===Moodle 2.2+===&lt;br /&gt;
&lt;br /&gt;
* [[Themes 2.2 how to clone a Moodle 2.2 theme]]&lt;br /&gt;
&lt;br /&gt;
===Moodle Bootstrap Themes - Moodle 2.5+===&lt;br /&gt;
&lt;br /&gt;
* [[Themes 2.5 How to copy and customise the Simple (bootstrap) theme]]&lt;br /&gt;
&lt;br /&gt;
[[de:Designs 2.0]]&lt;br /&gt;
[[es:Temas 2.0]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Themes_overview&amp;diff=46982</id>
		<title>Themes overview</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Themes_overview&amp;diff=46982"/>
		<updated>2014-12-03T09:19:06Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* Layout files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}Welcome to the new world of themes in Moodle 2.x!&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 2.0&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;
&lt;br /&gt;
==What&#039;s new in 2.7==&lt;br /&gt;
{{Moodle 2.7}}&lt;br /&gt;
&lt;br /&gt;
===Compiling LESS===&lt;br /&gt;
&lt;br /&gt;
Themes now have the ability to compile a LESS file on the fly. This was intended to be used for dynamic injection of LESS code or variables. (MDL-44357)&lt;br /&gt;
&lt;br /&gt;
==What&#039;s new in 2.6==&lt;br /&gt;
{{Moodle 2.6}}&lt;br /&gt;
&lt;br /&gt;
===Fonts===&lt;br /&gt;
&lt;br /&gt;
CSS3 fonts can be now used in plugins, core and moodle themes. It is very similar to images in pix subdirectories (MDL-23493).&lt;br /&gt;
&lt;br /&gt;
===Chat Activity===&lt;br /&gt;
&lt;br /&gt;
The Chat room window is now also styled via bootstrapbase. Themes based on bootstrapbase can now directly style or use &#039;customcss&#039; to style the chat window now. (MDL-42711)&lt;br /&gt;
&lt;br /&gt;
==What&#039;s new in 2.5==&lt;br /&gt;
{{Moodle 2.5}}&lt;br /&gt;
&lt;br /&gt;
There is a new Bootstrap base theme. See [[Clean theme]] for more information.&lt;br /&gt;
&lt;br /&gt;
==What&#039;s new in 2.4==&lt;br /&gt;
{{Moodle 2.4}}&lt;br /&gt;
&lt;br /&gt;
===HTML 5 doctype===&lt;br /&gt;
&lt;br /&gt;
By default Moodle is sending HTML5 doctype. Themes designers may decide to force old xhtml strict mode, but it is strongly discouraged and the site will not pass strictness validation. (MDL-34299)&lt;br /&gt;
&lt;br /&gt;
===Internet Explorer standards mode===&lt;br /&gt;
&lt;br /&gt;
Since 2.4 Moodle automatically sends X-UA-Compatible edge header, this should prevent Internet Explorer from switching to quirks or compatibility modes (MDL-36524). There is also a new workaround for intranet servers which previously identified recent IE browsers as IE7. (MDL-36481)&lt;br /&gt;
&lt;br /&gt;
===SVG icons===&lt;br /&gt;
&lt;br /&gt;
Most modern browsers support SVG icons. The benefit is that SVG scales perfectly to any screen resolution or zoom. It is now possible to add icons in SVG format to pix directories, Moodle uses SVG in supported browsers and PNG in legacy browsers. (MDL-22955)&lt;br /&gt;
&lt;br /&gt;
Please note that IE9 does not handle scaling of standard SVG icons properly, you may have to manually execute a special script from theme/base/cli/svgtool.php to alter the icons to be compatible with buggy IE9. (MDL-36436)&lt;br /&gt;
&lt;br /&gt;
==What&#039;s new in 2.0==&lt;br /&gt;
&lt;br /&gt;
The theme system was completely redesigned in Moodle 2.0.  Known issues have been addressed and new features have been added to meet community requests.&lt;br /&gt;
&lt;br /&gt;
Unfortunately it was not possible to maintain backward compatibility, so all Moodle 1.x themes need to be recreated for Moodle 2.0.&lt;br /&gt;
&lt;br /&gt;
Major changes include:&lt;br /&gt;
* Clearer and more consistent CSS classes and IDs throughout all pages in Moodle&lt;br /&gt;
* Introduction of layout files (templates) describing overall layout HTML for many different types of pages in Moodle.&lt;br /&gt;
* Introduction of renderers, which produce the smaller &amp;quot;parts&amp;quot; of a HTML page.  Advanced themes can choose to override these too if they choose.&lt;br /&gt;
* Introduction of standard methods for adding Javascript to themes.&lt;br /&gt;
* Easier control over icons and images in Moodle.&lt;br /&gt;
* The old &amp;quot;standard&amp;quot; theme has been split into two themes:&lt;br /&gt;
**&#039;&#039;&#039;base&#039;&#039;&#039; - contains absolutely basic layout, and&lt;br /&gt;
**&#039;&#039;&#039;standard&#039;&#039;&#039; - which adds CSS to the base theme to make it look like the old standard theme.&lt;br /&gt;
* Performance tuning: In normal production mode CSS files are combined into a single optimised file, and both CSS and JavaScript files are minimised to ensure there are no wasted connections or traffic.  Files are heavily cached, but also versioned, so that users never need to clear their caches.&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. (If you know Moodle 1.9, it&#039;s like a combination of header.html and footer.html).&lt;br /&gt;
# &#039;&#039;&#039;The base theme&#039;&#039;&#039; - is not intended to be used for production sites.  It sets up the simplest possible generic layout and includes only CSS essential to that layout &#039;&#039;or&#039;&#039; to Moodle as a whole.  It tries not to make any unnecessary rules and makes as few assumptions as possible.  It&#039;s the perfect base on which to start designing a theme, as there are very few colours, borders, margins, and alignments to override.  You can just start adding what you need.&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 classes and functions that are used by theme&lt;br /&gt;
|-&lt;br /&gt;
| /&lt;br /&gt;
| renderers.php &lt;br /&gt;
| Contains any custom renderers for the theme.&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 the theme user 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;
| /javascript/ &lt;br /&gt;
| *.js&lt;br /&gt;
| All specialty JavaScript files the theme requires should be located in here.&lt;br /&gt;
|-&lt;br /&gt;
| /lang/ &lt;br /&gt;
| &lt;br /&gt;
| Any special language files the theme requires should be located in here.&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;
&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;
==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 a basic theme configuration file and the different bits that make it up:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;newtheme&#039;;&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;parents = array(&lt;br /&gt;
    &#039;base&#039;&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&lt;br /&gt;
    &#039;admin&#039;,&lt;br /&gt;
    &#039;blocks&#039;,&lt;br /&gt;
    &#039;calendar&#039;,&lt;br /&gt;
    &#039;course&#039;,&lt;br /&gt;
    &#039;grade&#039;,&lt;br /&gt;
    &#039;message&#039;,&lt;br /&gt;
    &#039;question&#039;,&lt;br /&gt;
    &#039;user&#039;&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;layouts = array(&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;newtheme&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;theme&#039; =&amp;gt; &#039;newtheme&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    )&lt;br /&gt;
    //.......&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array(&lt;br /&gt;
    &#039;navigation&#039;&lt;br /&gt;
);&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;parents : This defines the themes that the theme will extend. In this case it is extending only the base theme.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;sheets : An array containing the names of the CSS stylesheets to include for this theme. 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;layouts : In this example, two layouts have been defined to override the layouts from the base theme. For more information see the [[#Layouts|layouts]] section below.&lt;br /&gt;
&lt;br /&gt;
; $THEME-&amp;gt;javascripts_footer : The final setting is to include a JavaScript file. Much like stylesheets, you only need to provide the files name. Moodle will assume it is in your themes JavaScript directory and be a .js file.&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.&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;
&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 within the themes provided in the standard install by Moodle there is a very clear organisation of CSS.&lt;br /&gt;
&lt;br /&gt;
First is the  pagelayout.css file. This contains the CSS required to give the layouts their look and feel.  It doesn&#039;t contain any rules that affect the content generated by Moodle.&lt;br /&gt;
&lt;br /&gt;
Next is the core.css file. If you open up core you will notice that it contains all manner of general (usually simple) rules that don&#039;t relate to a specific section of Moodle but to Moodle as a whole.&lt;br /&gt;
&lt;br /&gt;
There can also be rules that relate to specific sections.  However, this is done only when there are only a handful of rules for that section. These small clusters of rules are grouped together and separated by comments identifying for which section each relates.&lt;br /&gt;
&lt;br /&gt;
Finally there are all the other CSS files, you will notice that there is a file for each section of Moodle that has a significant collection of rules.&lt;br /&gt;
&lt;br /&gt;
:For those who are familiar with Moodle 1.9 theme&#039;s, this organisation will be a big change. In 1.9, CSS was organised by its nature (for example: colours, layout, other).&lt;br /&gt;
&lt;br /&gt;
===How to write effective CSS rules within Moodle===&lt;br /&gt;
In Moodle 2.0, 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;
As of Moodle 2.0 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;
&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 html4strict&amp;gt;&amp;lt;body id=”page-mod-forum-view” class=”path-mod path-mod-forum” /&amp;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;
==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. The standard theme in Moodle is a good example of this as it extends the base theme simply adding CSS to achieve its look and feel.&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;base&#039;,&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#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 base theme. If you take a look first at theme/base/config.php you will notice that several layouts specify options &#039;&#039;&#039;nonavbar&#039;&#039;&#039; and &#039;&#039;&#039;nofooter&#039;&#039;&#039; which can both be set to either true or false. Then if we take a look at theme/base/layout/general.php you will spot lines like the following:&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;
............&lt;br /&gt;
&amp;lt;?php if ($hasnavbar) { ?&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
What you are seeing here is the use of those settings from the layout within the layout file. In this case it is being used to toggle the display of the navigation bar and page footer.&lt;br /&gt;
&lt;br /&gt;
==Layout files==&lt;br /&gt;
A layout file is a file that contains the core HTML structure for a layout including the header, footer, content and block regions. For those of you who are familiar with themes in Moodle 1.9 this is simply header.html and footer.html combined. Of course it is not all HTML, there are bits of HTML and content that Moodle needs to put into the page, within each layout file this will be done by a couple of simple PHP calls to get bits and pieces including content.&lt;br /&gt;
&lt;br /&gt;
Before learning more it is good to understand the two primary objects that will be used in your layout files: $OUTPUT and $PAGE.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$OUTPUT&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;core_renderer&amp;lt;/code&amp;gt; class which is defined in lib/outputrenderers.php. Each method is clearly documented there, along with which is appropriate for use within the layout files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$PAGE&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;moodle_page&amp;lt;/code&amp;gt; class defined in lib/pagelib.php. Most of the things you will want to use are the properties that are all documented at the top of the file. If you are not familiar with PHP properties, you access them like $PAGE-&amp;gt;activityname, just like fields of an ordinary PHP object. (However, behind the scenes the value you get is produced by calling a function. Also, you cannot change these values, they are &#039;&#039;&#039;read-only&#039;&#039;&#039;. However, you don&#039;t need to understand all that if you are just using these properties in your theme.)&lt;br /&gt;
&lt;br /&gt;
The following is a very simple layout file to illustrate the different bits that make it up:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;doctype() ?&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid) ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses) ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td colspan=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
                if (method_exists($OUTPUT, &#039;user_menu)) {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;user_menu(); // user menu, for Moodle 2.8&lt;br /&gt;
                } else {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;login_info(); // login_info, Moodle 2.7 and before&lt;br /&gt;
                }&lt;br /&gt;
                echo $PAGE-&amp;gt;headingmenu;&lt;br /&gt;
              ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;tr&amp;gt;&lt;br /&gt;
        &amp;lt;td colspan=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
            &amp;lt;?php&lt;br /&gt;
            echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
            echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
            echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
            ?&amp;gt;&lt;br /&gt;
        &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html() ?&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 assume you know enough HTML to understand the basic structure above, but let&#039;s explain the PHP code since that is less obvious.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;doctype() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This occurs at the VERY top of the page, it must be the first bit of output and is responsible for adding the (X)HTML document type definition to the page. This of course is determined by the settings of the site and is one of the things that the theme designer has no control over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we have started writing the opening html tag and have asked Moodle to give us the HTML attributes that should be applied to it. This again is determined by several settings within the actual HTML install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This gets us the title for the page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This very important call gets us the standard head HTML that needs to be within the HEAD tag of the page. This is where CSS and JavaScript requirements for the top of the page will be output as well as any special script or style tags.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Much like the html tag above we have started writing the body tag and have asked for Moodle to get us the desired ID and classes that should be applied to it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading; ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;login_info(); echo $PAGE-&amp;gt;headingmenu; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are creating the header for the page. In this case we want the heading for the page, we want to display the login information which will be the current users username or a link to log in if they are not logged in, and we want the heading menu if there is one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we get the HTML to display the blocks that have been added to the page. In this case we have asked for all blocks that have been added to the area labelled &#039;&#039;side-pre&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is one of the most important calls within the file, it determines where the actual content for the page gets inserted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we get the HTML to display the blocks that have been added to the page. In this case we have asked for all blocks that have been added to the area labelled &#039;&#039;side-post&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This final bit of code gets the content for the footer of the page. It gets the login information which is the same as in the header, a home link, and the standard footer HTML which like the standard head HTML contains all of the script and style tags required by the page and requested to go in the footer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;&#039;&#039;: Within Moodle 2.0 most of the JavaScript for the page will be included in the footer. This greatly helps reduce the loading time of the page.&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;standard&#039; theme has a language file called lang/en/theme_standard.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 standard theme, adapt as required):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Standard&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;This theme is a very basic white theme, with a minimum amount of &lt;br /&gt;
 CSS added to the base theme to make it actually usable.&#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 HTML, such as if you wanted to use them within a layout file.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;imageone&#039;, &#039;theme&#039;);?&amp;gt;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt; &lt;br /&gt;
&amp;lt;img src=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;subdir/imagetwo&#039;, &#039;theme&#039;);?&amp;gt;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&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;
In this case rather than writing out the URL to the image we use a method of Moodle&#039;s output library. 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;
&lt;br /&gt;
The following is how you would use the images from within CSS as background images.&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;
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 module images we need a &#039;&#039;&#039;pix_mod&#039;&#039;&#039; directory.&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;
==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;base&#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;
==Appendix A==&lt;br /&gt;
===Theme options as of 8th April 2014===&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.&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;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 within the body of the 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;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;filter_mediaplugin_colors&#039;&#039;&#039;&lt;br /&gt;
|  Used to control the colours used in the small media player for the filters&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)&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.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;larrow&#039;&#039;&#039;&lt;br /&gt;
|  Overrides the left arrow image used throughout Moodle&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;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;rarrow&#039;&#039;&#039;&lt;br /&gt;
|  Overrides the right arrow image used throughout Moodle&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.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;resource_mp3player_colors&#039;&#039;&#039;&lt;br /&gt;
|  Controls the colours for the MP3 player&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.&lt;br /&gt;
|-&lt;br /&gt;
|  $THEME-&amp;gt;&#039;&#039;&#039;supportscssoptimisation&#039;&#039;&#039;&lt;br /&gt;
|  When set to &#039;FALSE&#039; then the theme will not be affected by the &#039;CSS Optimiser&#039;.  The &#039;CSS Optimiser&#039; is enabled in Development &amp;gt; Experimental &amp;gt; Experimental settings.  When it is enabled CSS will be run through an optimisation process before being cached. The optimiser processes the CSS removing duplicate rules and styles, as well as white space removable and reformatting. Please note turning this on at the same time as theme designer mode is awful for performance but will help theme designers create optimised CSS.&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.&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;
* [[Theme changes in 2.0]]&lt;br /&gt;
* [[Adding courses and categories to the custom menu]] &lt;br /&gt;
* [[Making a horizontal dock]]&lt;br /&gt;
* [[Adding theme upgrade code]]&lt;br /&gt;
* [[Styling and customising the dock]] &lt;br /&gt;
* [[Changing topic or weekly outline to Page heading]]&lt;br /&gt;
* [[jQuery]]&lt;br /&gt;
&lt;br /&gt;
===Moodle 2.2+===&lt;br /&gt;
&lt;br /&gt;
* [[Themes 2.2 how to clone a Moodle 2.2 theme]]&lt;br /&gt;
&lt;br /&gt;
===Moodle Bootstrap Themes - Moodle 2.5+===&lt;br /&gt;
&lt;br /&gt;
* [[Themes 2.5 How to copy and customise the Simple (bootstrap) theme]]&lt;br /&gt;
&lt;br /&gt;
[[de:Designs 2.0]]&lt;br /&gt;
[[es:Temas 2.0]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme&amp;diff=46981</id>
		<title>Creating a theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme&amp;diff=46981"/>
		<updated>2014-12-03T09:17:35Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* The page header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}This document describes how to create a theme for Moodle 2.x.x. It assumes you have some understanding of how themes within Moodle work as well as a good understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
===Theme designer mode===&lt;br /&gt;
&lt;br /&gt;
Under normal operation Moodle does several things in the name of performance, one of these is to combine all of the CSS into one file, minimize it, cache it on the server, and then serve it. After the first request the cached version is served to greatly improve page performance. &lt;br /&gt;
&lt;br /&gt;
What this means for you as a themer? When you make changes they will not be seen immediately. In fact you will need to tell Moodle to rebuild the cache that it is serving.&lt;br /&gt;
This isn&#039;t practical for designing themes of course so the &#039;&#039;&#039;theme designer mode&#039;&#039;&#039; was added. When enabled it tells Moodle not to combine or cache the CSS that gets delivered. This has the downside that page load times will take significantly longer, however you will see your changes immediately every time.&lt;br /&gt;
&lt;br /&gt;
Theme designer mode may be enabled via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; [[Theme settings]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Internet Explorer versions 6 and 7 have BIG problems when a site attempts to link to more than 31 stylesheets, in which case either a limited number or no styles get applied. Because Moodle sends up all of the CSS all of the time with theme designer mode turned on there is a very high chance you will get more than 31 stylesheets being included. This will, of course, cause major problems for Internet Explorer until theme designer mode is turned off.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing you need to do is create the directories and files you will be using, the first thing to create is the actual directory for your theme. This should be the name of your theme, in my case it&#039;s &#039;excitement&#039;. The directory should be located within the theme directory of Moodle, ./moodle/theme/excitement/ will be the directory I create.&lt;br /&gt;
&lt;br /&gt;
Now within that directory we can immediately create several files that we know we are going to need. &lt;br /&gt;
&lt;br /&gt;
So the files that we want to create are:&lt;br /&gt;
; config.php :  All of our settings will go here.&lt;br /&gt;
; /style/ : This directory will contain all of our stylesheets.&lt;br /&gt;
; /style/excitement.css : All of our css will go in here.&lt;br /&gt;
; /pix/ : Into this directory we&#039;ll put a screen shot of our theme as well as our favicon and any images we use in CSS.&lt;br /&gt;
; /layout/ : Our layout files will end up in this directory.&lt;br /&gt;
; /layout/standard.php : This will be our one basic layout file.&lt;br /&gt;
; /lang/en/ : The file we put here will make our theme name show properly on the Theme Selector page. You need a few standard entries. Copy the one from the Standard theme and modify is easiest. &lt;br /&gt;
&lt;br /&gt;
So after this setup step you should have a directory structure similar to what is shown below.&lt;br /&gt;
&lt;br /&gt;
[[image:Learn_to_theme_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Configuring our theme==&lt;br /&gt;
&lt;br /&gt;
Open config.php in your favourite editor and start by adding the opening PHP tags &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;lt;?php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Now we need to add the settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;excitement&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Very simply this tells Moodle the name of your theme, and if you ever have several config.php files open this will help you identify which one you are looking at.&lt;br /&gt;
&lt;br /&gt;
Next, the parents for this theme.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;parents = array(&#039;base&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This tells Moodle that my new theme &#039;&#039;`excitement`&#039; wants to extend the base theme. &lt;br /&gt;
&lt;br /&gt;
A theme can extend any number of themes. Rather than creating an entirely new theme and copying all of the CSS, you can simply create a new theme, extend the theme you like and just add the changes you want to your theme. &lt;br /&gt;
&lt;br /&gt;
Also worth noting is the purpose of the base theme: it provides us with a basic layout and just enough CSS to make everything fall into place.&lt;br /&gt;
&lt;br /&gt;
Now we will tell Moodle about our stylesheets:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&#039;excitement&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final thing we need to add into our theme&#039;s config.php file is the definition of the layouts for our theme:&lt;br /&gt;
(in the code below, replace &#039;general.php&#039; with &#039;standard.php&#039; because that is the file that is previously created)&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts = array(&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;general.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&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;general.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.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;general.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, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nologininfo&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#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;general.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;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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, and it is good idea if it does not have links to&lt;br /&gt;
    // other places - for example there should not be a home link in the footer...&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;noblocks&#039;=&amp;gt;true, &#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;noblocks&#039;=&amp;gt;true, &#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;false, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;report.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nologinlinks&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/** List of javascript files that need to be included on each page */&lt;br /&gt;
$THEME-&amp;gt;javascripts = array();&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you are looking at is the different layouts for our theme. Why are there so many? Because, that is how many there are in Moodle. There is one for every general type of page. With my &#039;&#039;`excitement`&#039;&#039; theme I have chosen to use my own layout. Unless there was a specific reason to do so, normally you would not need to create your own layouts, you could extend the base theme, and use its layouts, meaning you would only have to write CSS to achieve your desired look.&lt;br /&gt;
&lt;br /&gt;
For each layout above, you will notice the following four things are being set:&lt;br /&gt;
; file : This is the name of the layout file we want to use, it should always be located in the above themes layout directory. For us this is of course standard.php as we only have one layout file.&lt;br /&gt;
; regions : This is an array of block regions that our theme has. Each entry in here can be used to put blocks in when that layout is being used.&lt;br /&gt;
; defaultregion : If a layout has regions it should have a default region, this is where blocks get put when first added. It is also where the &amp;quot;add block&amp;quot; block is shown when editing is on.&lt;br /&gt;
; options : These are special settings, anything that gets put into the options array is available later on when we are writing our layout file.&lt;br /&gt;
&lt;br /&gt;
There are additional settings that can be defined in the config.php file - see [[Themes 2.0|Themes 2.0]] for the full list.&lt;br /&gt;
&lt;br /&gt;
==Configuring the language file==&lt;br /&gt;
Open theme_base.php file from &#039;&#039;&#039;base/lang/en/theme_base.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Save it as &#039;&#039;&#039;excitement/lang/en/theme_excitement.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Change &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Base&#039;; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Excitement&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After making these changes and perhaps clearing theme caches and/or purging all caches, the new theme name should now show properly in the Theme Selector: &#039;&#039;Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme Selector&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can also edit the theme description:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Write your theme description here.&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to leave the following two lines in place (you can change the wording if you need to) to avoid notices when editing blocks etc.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Writing the layout file==&lt;br /&gt;
&lt;br /&gt;
The excitement theme has just one layout file.&lt;br /&gt;
&lt;br /&gt;
The downside of this is that I have to make the layout file do everything I want which means I need to make use of some options (as defined in the layouts in config.php). &lt;br /&gt;
&lt;br /&gt;
The upside is that I only need to maintain one file. &lt;br /&gt;
&lt;br /&gt;
Other than maintenance, using multiple layout files provides many advantages to real world themes in that you can easily tweak and customise specific layouts to achieve the goals of the organisation using the theme.&lt;br /&gt;
&lt;br /&gt;
Before learning more it is good to understand the two primary objects that will be used in your layout files: $OUTPUT and $PAGE.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$OUTPUT&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;core_renderer&amp;lt;/code&amp;gt; class which is defined in lib/outputrenderers.php. Each method is clearly documented there, along with which is appropriate for use within the layout files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$PAGE&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;moodle_page&amp;lt;/code&amp;gt; class defined in lib/pagelib.php. Most of the things you will want to use are the properties that are all documented at the top of the file. If you are not familiar with PHP properties, you access them like $PAGE-&amp;gt;activityname, just like fields of an ordinary PHP object. (However, behind the scenes the value you get is produced by calling a function. Also, you cannot change these values, they are &#039;&#039;&#039;read-only&#039;&#039;&#039;. However, you don&#039;t need to understand all that if you are just using these properties in your theme.)&lt;br /&gt;
&lt;br /&gt;
So lets start writing standard.php, the layout file for my &#039;&#039;`excitement`&#039;&#039; theme.&lt;br /&gt;
&lt;br /&gt;
===The top of the layout file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$hassidepre = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-pre&#039;, $OUTPUT);&lt;br /&gt;
$hassidepost = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-post&#039;, $OUTPUT);&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype(); ?&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the code that goes into this section:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is very important and is required to go at the very top of the page. This tells Moodle to print out the document type tag that is determined by the settings within Moodle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we open the HTML tag and then ask Moodle to print the attributes that should go inside it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Simply creates the title tag and asks Moodle to fill it in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are asking Moodle to print all of the other tags and content that need to go into the head. This includes stylesheets, script tags, and inline JavaScript code.&lt;br /&gt;
&lt;br /&gt;
===The page header===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
                if (method_exists($OUTPUT, &#039;user_menu&#039;)) {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;user_menu(); // user menu, for Moodle 2.8&lt;br /&gt;
                } else {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;login_info(); // login_info, Moodle 2.7 and before&lt;br /&gt;
                }&lt;br /&gt;
                if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
                    echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
                }&lt;br /&gt;
                echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
            ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
        &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So there is a bit more going on here obviously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again much like what we did for the opening HTML tag in the head we have started writing the opening body tag and are then asking Moodle to give us the ID we should use for the body tag as well as the classes we should use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This very important call writes some critical bits of JavaScript into the page. It should always be located after the body tag as soon as possible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
......&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are checking whether or not we need to print the header for the page. There are three checks we need to make here:&lt;br /&gt;
# &#039;&#039;&#039;$PAGE-&amp;gt;heading&#039;&#039;&#039; : This checks to make sure that there is a heading for the page. This will have been set by the script and normally describes the page in a couple of words.&lt;br /&gt;
# &#039;&#039;&#039;empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;])&#039;&#039;&#039; : Now this check is looking at the layout options that we set in our config.php file. It is looking to see if the layout set &#039;nonavbar&#039; =&amp;gt; true.&lt;br /&gt;
# &#039;&#039;&#039;$PAGE-&amp;gt;has_navbar()&#039;&#039;&#039; The third check is to check with the page whether it has a navigation bar to display.&lt;br /&gt;
If either there is a heading for this page or there is a navigation bar to display then we will display a heading.&lt;br /&gt;
&lt;br /&gt;
Leading on from this lets assume that there is a header to print.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
    .....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line is simply saying if the page has a heading print it. In this case we run the first check above again just to make sure there is a heading, we then open a heading tag that we choose and ask the page to print the heading.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
    echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
    if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
        echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
    }&lt;br /&gt;
    echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are looking to print the menu and content that you see at the top of the page (usually to the right). We start by getting Moodle to print the login information for the current user. If the user is logged in this will be their name and a link to their profile, if not then it will be a link to login.&lt;br /&gt;
&lt;br /&gt;
Next we check our page options to see whether a language menu should be printed. If in the layout definition within config.php it sets &#039;&#039;&#039;langmenu =&amp;gt; true&#039;&#039;&#039; then we will print the language menu, a drop down box that lets the user change the language that Moodle displays in.&lt;br /&gt;
&lt;br /&gt;
Finally the page also has a heading menu that can be printed. This heading menu is special HTML that the page you are viewing wants to add. It can be anything from drop down boxes to buttons and any number of each.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The final part of the header.&lt;br /&gt;
&lt;br /&gt;
Here we want to print the navigation bar for the page if there is one. To find out if there is one we run checks number 2 and 3 again and proceed if they pass.&lt;br /&gt;
&lt;br /&gt;
Assuming there is a header then there are two things that we need to print. The first is the navigation bar. This is a component that the OUTPUT library knows about. The second is a button to show on the page.&lt;br /&gt;
&lt;br /&gt;
In both cases we choose to wrap them in a div tag with a class attribute to enable theming on those elements.&lt;br /&gt;
&lt;br /&gt;
Well that is it for the header. There is a lot of PHP compared to the other sections of the layout file but it does not change and can be copied and pasted between themes.&lt;br /&gt;
&lt;br /&gt;
===The page content===&lt;br /&gt;
&lt;br /&gt;
I am going with the default two block regions plus the main content.&lt;br /&gt;
&lt;br /&gt;
Because I have based this theme and layout file on the base theme the HTML looks a little intense. This is because it is a floating div layout where the content comes first and then we get the columns (even though one column will be to the left of the content.) Don&#039;t worry too much about it. When it comes to writing your own theme you can go about it as you choose.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page-content&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;region-main-box&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;region-post-box&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;div id=&amp;quot;region-main-wrap&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-main&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&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;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-pre&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
                &lt;br /&gt;
                &amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-post&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;?php } ?&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;
In regards to PHP this section is very easy. There are only three lines for the whole section one to get the main content and one for each block region.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line prints the main content for the page.&lt;br /&gt;
PLEASE NOTE: In Moodle 2.2 onwards &amp;quot;core_renderer::MAIN_CONTENT_TOKEN&amp;quot; changed to &amp;quot;$OUTPUT-&amp;gt;main_content()&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
These lines of code check the variables we created earlier on to decide whether we should show the pre block region. If you try to display a block region that isn&#039;t there or has no content then Moodle will give you an error message so these lines are very important.&lt;br /&gt;
&lt;br /&gt;
For those who get an error message if it is &amp;quot;unknown block region side-pre&amp;quot; or &amp;quot;unknown block region side-post&amp;quot; then this is the issue you are experiencing. Simply add the following lines and all will be fine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line gets all of the blocks and more particularly the content for the block region &#039;&#039;&#039;side-pre&#039;&#039;&#039;. This block region will be displayed to the left of the content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again we should make this check for every block region as there are some pages that have no blocks what-so-ever.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are getting the other block region &#039;&#039;&#039;side-post&#039;&#039;&#039; which will be displayed to the right of the content.&lt;br /&gt;
&lt;br /&gt;
===The page footer===&lt;br /&gt;
Here we want to print the footer for the page, any content required by Moodle, and then close the last tags.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html() ?&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;
The section of code is responsible for printing the footer for the page.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first thing we do before printing the footer is check that we actually want to print it. This is done by checking the options for the layout as defined in the config.php file. If &#039;&#039;&#039;nofooter =&amp;gt; true&#039;&#039;&#039; is set the we don&#039;t want to print the footer and should skip over this body of code.&lt;br /&gt;
&lt;br /&gt;
Assuming we want to print a footer we proceed to create a div to house its content and then print the bits of the content that will make it up.&lt;br /&gt;
There are four things that the typical page footer will want to print:&lt;br /&gt;
; echo page_doc_link(get_string(&#039;moodledocslink&#039;)) : This will print a link to the Moodle.org help page for this particular page.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;login_info(); : This is the same as at the top of the page and will print the login information for the current user.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;home_link(); : This prints a link back to the Moodle home page for this site.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;standard_footer_html(); : This prints special HTML that is determined by the settings for the site. Things such as performance information or debugging will be printed by this line if they are turned on.&lt;br /&gt;
&lt;br /&gt;
And the final line of code for our layout file is:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is one of the most important lines of code in the layout file. It asks Moodle to print any required content into the page, and there will likely be a lot although most of it will not be visual.&lt;br /&gt;
&lt;br /&gt;
It will instead be things such as inline scripts and JavaScript files required to go at the bottom of the page. If you forget this line its likely no JavaScript will work!&lt;br /&gt;
&lt;br /&gt;
We&#039;ve now written our layout file and it is all set to go. The complete source is below for reference. Remember if you want more practical examples simply look at the layout files located within the layout directory of other themes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$hassidepre = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-pre&#039;, $OUTPUT);&lt;br /&gt;
$hassidepost = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-post&#039;, $OUTPUT);&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype() ?&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title; ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;favicon&#039;, &#039;theme&#039;)?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
        &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
            echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
            if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
                echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
            }&lt;br /&gt;
            echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
        ?&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
        &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-content&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;region-main-box&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;div id=&amp;quot;region-post-box&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-main-wrap&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div id=&amp;quot;region-main&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                            &amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&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;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-pre&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
                &lt;br /&gt;
                &amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-post&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&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;
&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html() ?&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;
==Adding some CSS==&lt;br /&gt;
With config.php and standard.php both complete the theme is now usable and starting to look like a real theme, however if you change to it using the theme selector you will notice that it still lacks any style.&lt;br /&gt;
&lt;br /&gt;
This of course is where CSS comes in. When writing code Moodle developers are strongly encouraged to not use inline styles anywhere. This is fantastic for us as themers because there is nothing (or at least very little) in Moodle that cannot be styled using CSS.&lt;br /&gt;
&lt;br /&gt;
===Moodle CSS basics===&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.0 all of the CSS for the whole of Moodle is delivered all of the time! This was done for performance reasons. Moodle now reads in all of the CSS, combines it into one file, shrinks it removing any white space, caches it, and then delivers it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What this means for you as a themer?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You will need to write good CSS that won&#039;t clash with any other CSS within Moodle.&lt;br /&gt;
&lt;br /&gt;
Moodle is so big and complex,there is no way to ensure that classes don&#039;t get reused. What we can control however is the classes and id that get added to the body tag for every page. When writing CSS it is highly encouraged to make full use of these body classes, using them will help ensure the CSS you write has the least chance of causing conflicts.&lt;br /&gt;
&lt;br /&gt;
You should also take the time to look at how the Moodle themes use CSS. Look at their use of the body classes and how they separate the CSS for the theme into separate files based on the region of Moodle it applies to.&lt;br /&gt;
&lt;br /&gt;
Check out [[Themes 2.0|Themes 2.0]] and [[CSS coding style]] for more information about writing good CSS.&lt;br /&gt;
&lt;br /&gt;
===Starting to write excitement.css===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
a {&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.addcoursebutton .singlebutton {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1.headermain {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.main {&lt;br /&gt;
    border-bottom: 3px solid #013D6A;&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock {&lt;br /&gt;
    font-size: 18pt;&lt;br /&gt;
    margin-top: 0;&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header {&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header .headermenu {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header .headermenu a {&lt;br /&gt;
    color: #FDFF2A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar {&lt;br /&gt;
    padding-left: 1em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.breadcrumb li {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.breadcrumb li a {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block {&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .header .title {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .header .title .block_action input {&lt;br /&gt;
    background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .content {&lt;br /&gt;
    border: 1px solid #000;&lt;br /&gt;
    padding: 5px;&lt;br /&gt;
    background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .content .block_tree p {&lt;br /&gt;
    font-size: 80%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform {&lt;br /&gt;
    margin-left: 5%;&lt;br /&gt;
    width: 90%;&lt;br /&gt;
    font-size: 9pt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform #adminsearchquery {&lt;br /&gt;
    width: 95%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .calendar-controls a {&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
    font-weight: bold;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar td {&lt;br /&gt;
    border-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .day a {&lt;br /&gt;
    color: #FFF000;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays th {&lt;br /&gt;
    border-width: 0;&lt;br /&gt;
    font-weight: bold;&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays abbr {&lt;br /&gt;
    border-width: 0;&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
[[image:Learn_to_theme_02.jpg|400px|thumb|Excitement theme screenshot]]&lt;br /&gt;
This isn&#039;t all of the CSS for the theme, but just enough to style the front page when the user is not logged in.&lt;br /&gt;
Remember this theme extends the base theme so there is already CSS for layout as well.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* The CSS is laid out in a single line format. This is done within the core themes for Moodle. It makes it quicker to read the selectors and see what is being styled.&lt;br /&gt;
* I have written my selectors to take into account the structure of the HTML (more than just the one tag I want to style). This helps further to reduce the conflicts that I may encounter.&lt;br /&gt;
* I use generic classes like &#039;&#039;.sideblock&#039;&#039; only where I want to be generic, as soon as I want to be specific I use the unique classes such as &#039;&#039;.block_calendar_month&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using images within CSS===&lt;br /&gt;
&lt;br /&gt;
I will add two image files to the pix directory of my theme:&lt;br /&gt;
; /theme/excitement/pix/background.png : This will be the background image for my theme.&lt;br /&gt;
; /theme/excitement/pix/gradient.jpg : This will be a gradient I use for the header and headings.&lt;br /&gt;
I quickly created both of these images using gimp and simply saved them to the pix directory.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
html {&lt;br /&gt;
    background-image: url([[pix:theme|background]]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock,&lt;br /&gt;
#page-header,&lt;br /&gt;
.sideblock,&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {&lt;br /&gt;
    background-image: url([[pix:theme|gradient]]);&lt;br /&gt;
    background-repeat: repeat-x;&lt;br /&gt;
    background-color: #0273C8;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
[[image:Learn_to_theme_03.jpg‎|400px|thumb|Excitement theme screenshot]]&lt;br /&gt;
The CSS above is the two new rules that I had to write to use my images within CSS.&lt;br /&gt;
&lt;br /&gt;
The first rule sets the background image for the page to background.png&lt;br /&gt;
&lt;br /&gt;
The second rule sets the background for headings, and the sideblocks to use gradient.jpg&lt;br /&gt;
&lt;br /&gt;
You will notice that I did not need to write a path to the image. This is because Moodle has this special syntax that can be used and will be replaced when the CSS is parsed before delivery.&lt;br /&gt;
The advantage of using this syntax over writing the path in is that the path may change depending on where you are or what theme is being used.&lt;br /&gt;
&lt;br /&gt;
Other themers may choose to extend your theme with their own; if you use this syntax then all they need to do to override the image is to create one with the same name in their themes directory.&lt;br /&gt;
&lt;br /&gt;
You will also notice that I don&#039;t need to add the image files extension. This is because Moodle is smart enough to work out what extension the file uses. It also allows themers to override images with different formats.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot; /&amp;gt;&lt;br /&gt;
The following is the complete CSS for my theme:&lt;br /&gt;
&amp;lt;div style=&amp;quot;overflow:auto;height:860px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
a {text-decoration: none;}&lt;br /&gt;
.addcoursebutton .singlebutton {text-align: center;}&lt;br /&gt;
&lt;br /&gt;
h1.headermain {color: #fff;}&lt;br /&gt;
h2.main {border-bottom: 3px solid #013D6A;color: #013D6A;text-align: center;}&lt;br /&gt;
h2.headingblock {font-size: 18pt;margin-top: 0;background-color: #013D6A;color: #FFF;text-align: center;}&lt;br /&gt;
#page-header {background-color: #013D6A;border-bottom:5px solid #013D6A;}&lt;br /&gt;
#page-header .headermenu  {color: #FFF;}&lt;br /&gt;
#page-header .headermenu a {color: #FDFF2A;}&lt;br /&gt;
&lt;br /&gt;
.sideblock {background-color: #013D6A;}&lt;br /&gt;
.sideblock .header .title {color: #FFF;}&lt;br /&gt;
.sideblock .header .title .block_action input {background-color: #FFF;}&lt;br /&gt;
.sideblock .content {border: 1px solid #000;padding: 5px;background-color: #FFF;}&lt;br /&gt;
.sideblock .content .block_tree p {font-size: 80%;}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer {text-align: center;}&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform {margin-left: 5%;width: 90%;font-size: 9pt;}&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform #adminsearchquery {width: 95%;}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .calendar-controls a {color: #013D6A;font-weight: bold;}&lt;br /&gt;
.block_calendar_month .content .minicalendar td {border-color: #FFF;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {color: #FFF;background-color: #013D6A;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .day a {color: #FFF000;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays th {border-width: 0;font-weight: bold;color: #013D6A;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays abbr {border-width: 0;text-decoration: none;}&lt;br /&gt;
&lt;br /&gt;
html {background-image:url([[pix:theme|background]]);}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock,&lt;br /&gt;
#page-header,&lt;br /&gt;
.sideblock,&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {background-image:url([[pix:theme|gradient]]);&lt;br /&gt;
   background-repeat:repeat-x;background-color: #0273C8;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding a screenshot and favicon==&lt;br /&gt;
The final thing to do at this point is add both a screenshot for this theme as well as a favicon for it.&lt;br /&gt;
The screenshot will be shown in the theme selector screen and should be named &#039;&#039;screenshot.jpg&#039;&#039;.&lt;br /&gt;
The favicon will be used when someone bookmarks this page.&lt;br /&gt;
Both images should be located in your themes pix directory as follows:&lt;br /&gt;
* /theme/excitement/pix/screenshot.jpg&lt;br /&gt;
* /theme/excitement/pix/favicon.ico&lt;br /&gt;
&lt;br /&gt;
In the case of my theme I have taken a screenshot and added it to that directory, and because I don&#039;t really want to do anything special with the favicon I have copied it from /theme/base/pix/favicon.ico so that at least it will be recognisable as Moodle.&lt;br /&gt;
&lt;br /&gt;
[[es:Desarollo:Temas 2.0 creando tu primer tema]]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme&amp;diff=46980</id>
		<title>Creating a theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme&amp;diff=46980"/>
		<updated>2014-12-03T09:17:11Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* The page header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}This document describes how to create a theme for Moodle 2.x.x. It assumes you have some understanding of how themes within Moodle work as well as a good understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
===Theme designer mode===&lt;br /&gt;
&lt;br /&gt;
Under normal operation Moodle does several things in the name of performance, one of these is to combine all of the CSS into one file, minimize it, cache it on the server, and then serve it. After the first request the cached version is served to greatly improve page performance. &lt;br /&gt;
&lt;br /&gt;
What this means for you as a themer? When you make changes they will not be seen immediately. In fact you will need to tell Moodle to rebuild the cache that it is serving.&lt;br /&gt;
This isn&#039;t practical for designing themes of course so the &#039;&#039;&#039;theme designer mode&#039;&#039;&#039; was added. When enabled it tells Moodle not to combine or cache the CSS that gets delivered. This has the downside that page load times will take significantly longer, however you will see your changes immediately every time.&lt;br /&gt;
&lt;br /&gt;
Theme designer mode may be enabled via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; [[Theme settings]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Internet Explorer versions 6 and 7 have BIG problems when a site attempts to link to more than 31 stylesheets, in which case either a limited number or no styles get applied. Because Moodle sends up all of the CSS all of the time with theme designer mode turned on there is a very high chance you will get more than 31 stylesheets being included. This will, of course, cause major problems for Internet Explorer until theme designer mode is turned off.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing you need to do is create the directories and files you will be using, the first thing to create is the actual directory for your theme. This should be the name of your theme, in my case it&#039;s &#039;excitement&#039;. The directory should be located within the theme directory of Moodle, ./moodle/theme/excitement/ will be the directory I create.&lt;br /&gt;
&lt;br /&gt;
Now within that directory we can immediately create several files that we know we are going to need. &lt;br /&gt;
&lt;br /&gt;
So the files that we want to create are:&lt;br /&gt;
; config.php :  All of our settings will go here.&lt;br /&gt;
; /style/ : This directory will contain all of our stylesheets.&lt;br /&gt;
; /style/excitement.css : All of our css will go in here.&lt;br /&gt;
; /pix/ : Into this directory we&#039;ll put a screen shot of our theme as well as our favicon and any images we use in CSS.&lt;br /&gt;
; /layout/ : Our layout files will end up in this directory.&lt;br /&gt;
; /layout/standard.php : This will be our one basic layout file.&lt;br /&gt;
; /lang/en/ : The file we put here will make our theme name show properly on the Theme Selector page. You need a few standard entries. Copy the one from the Standard theme and modify is easiest. &lt;br /&gt;
&lt;br /&gt;
So after this setup step you should have a directory structure similar to what is shown below.&lt;br /&gt;
&lt;br /&gt;
[[image:Learn_to_theme_01.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Configuring our theme==&lt;br /&gt;
&lt;br /&gt;
Open config.php in your favourite editor and start by adding the opening PHP tags &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;lt;?php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Now we need to add the settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;excitement&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Very simply this tells Moodle the name of your theme, and if you ever have several config.php files open this will help you identify which one you are looking at.&lt;br /&gt;
&lt;br /&gt;
Next, the parents for this theme.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;parents = array(&#039;base&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This tells Moodle that my new theme &#039;&#039;`excitement`&#039; wants to extend the base theme. &lt;br /&gt;
&lt;br /&gt;
A theme can extend any number of themes. Rather than creating an entirely new theme and copying all of the CSS, you can simply create a new theme, extend the theme you like and just add the changes you want to your theme. &lt;br /&gt;
&lt;br /&gt;
Also worth noting is the purpose of the base theme: it provides us with a basic layout and just enough CSS to make everything fall into place.&lt;br /&gt;
&lt;br /&gt;
Now we will tell Moodle about our stylesheets:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&#039;excitement&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final thing we need to add into our theme&#039;s config.php file is the definition of the layouts for our theme:&lt;br /&gt;
(in the code below, replace &#039;general.php&#039; with &#039;standard.php&#039; because that is the file that is previously created)&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts = array(&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;general.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&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;general.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#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;general.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;general.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, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nologininfo&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#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;general.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;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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, and it is good idea if it does not have links to&lt;br /&gt;
    // other places - for example there should not be a home link in the footer...&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;noblocks&#039;=&amp;gt;true, &#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;noblocks&#039;=&amp;gt;true, &#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;false, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&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;report.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;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true, &#039;nologinlinks&#039;=&amp;gt;true, &#039;nocourseheaderfooter&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/** List of javascript files that need to be included on each page */&lt;br /&gt;
$THEME-&amp;gt;javascripts = array();&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you are looking at is the different layouts for our theme. Why are there so many? Because, that is how many there are in Moodle. There is one for every general type of page. With my &#039;&#039;`excitement`&#039;&#039; theme I have chosen to use my own layout. Unless there was a specific reason to do so, normally you would not need to create your own layouts, you could extend the base theme, and use its layouts, meaning you would only have to write CSS to achieve your desired look.&lt;br /&gt;
&lt;br /&gt;
For each layout above, you will notice the following four things are being set:&lt;br /&gt;
; file : This is the name of the layout file we want to use, it should always be located in the above themes layout directory. For us this is of course standard.php as we only have one layout file.&lt;br /&gt;
; regions : This is an array of block regions that our theme has. Each entry in here can be used to put blocks in when that layout is being used.&lt;br /&gt;
; defaultregion : If a layout has regions it should have a default region, this is where blocks get put when first added. It is also where the &amp;quot;add block&amp;quot; block is shown when editing is on.&lt;br /&gt;
; options : These are special settings, anything that gets put into the options array is available later on when we are writing our layout file.&lt;br /&gt;
&lt;br /&gt;
There are additional settings that can be defined in the config.php file - see [[Themes 2.0|Themes 2.0]] for the full list.&lt;br /&gt;
&lt;br /&gt;
==Configuring the language file==&lt;br /&gt;
Open theme_base.php file from &#039;&#039;&#039;base/lang/en/theme_base.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Save it as &#039;&#039;&#039;excitement/lang/en/theme_excitement.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Change &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Base&#039;; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Excitement&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After making these changes and perhaps clearing theme caches and/or purging all caches, the new theme name should now show properly in the Theme Selector: &#039;&#039;Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme Selector&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can also edit the theme description:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Write your theme description here.&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to leave the following two lines in place (you can change the wording if you need to) to avoid notices when editing blocks etc.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Writing the layout file==&lt;br /&gt;
&lt;br /&gt;
The excitement theme has just one layout file.&lt;br /&gt;
&lt;br /&gt;
The downside of this is that I have to make the layout file do everything I want which means I need to make use of some options (as defined in the layouts in config.php). &lt;br /&gt;
&lt;br /&gt;
The upside is that I only need to maintain one file. &lt;br /&gt;
&lt;br /&gt;
Other than maintenance, using multiple layout files provides many advantages to real world themes in that you can easily tweak and customise specific layouts to achieve the goals of the organisation using the theme.&lt;br /&gt;
&lt;br /&gt;
Before learning more it is good to understand the two primary objects that will be used in your layout files: $OUTPUT and $PAGE.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$OUTPUT&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;core_renderer&amp;lt;/code&amp;gt; class which is defined in lib/outputrenderers.php. Each method is clearly documented there, along with which is appropriate for use within the layout files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$PAGE&#039;&#039;&#039; is an instance of the &amp;lt;code&amp;gt;moodle_page&amp;lt;/code&amp;gt; class defined in lib/pagelib.php. Most of the things you will want to use are the properties that are all documented at the top of the file. If you are not familiar with PHP properties, you access them like $PAGE-&amp;gt;activityname, just like fields of an ordinary PHP object. (However, behind the scenes the value you get is produced by calling a function. Also, you cannot change these values, they are &#039;&#039;&#039;read-only&#039;&#039;&#039;. However, you don&#039;t need to understand all that if you are just using these properties in your theme.)&lt;br /&gt;
&lt;br /&gt;
So lets start writing standard.php, the layout file for my &#039;&#039;`excitement`&#039;&#039; theme.&lt;br /&gt;
&lt;br /&gt;
===The top of the layout file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$hassidepre = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-pre&#039;, $OUTPUT);&lt;br /&gt;
$hassidepost = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-post&#039;, $OUTPUT);&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype(); ?&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the code that goes into this section:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is very important and is required to go at the very top of the page. This tells Moodle to print out the document type tag that is determined by the settings within Moodle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we open the HTML tag and then ask Moodle to print the attributes that should go inside it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Simply creates the title tag and asks Moodle to fill it in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are asking Moodle to print all of the other tags and content that need to go into the head. This includes stylesheets, script tags, and inline JavaScript code.&lt;br /&gt;
&lt;br /&gt;
===The page header===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
                if (method_exists($OUTPUT, &#039;user_menu)) {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;user_menu(); // user menu, for Moodle 2.8&lt;br /&gt;
                } else {&lt;br /&gt;
                  echo $OUTPUT-&amp;gt;login_info(); // login_info, Moodle 2.7 and before&lt;br /&gt;
                }&lt;br /&gt;
                if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
                    echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
                }&lt;br /&gt;
                echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
            ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
        &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So there is a bit more going on here obviously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again much like what we did for the opening HTML tag in the head we have started writing the opening body tag and are then asking Moodle to give us the ID we should use for the body tag as well as the classes we should use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This very important call writes some critical bits of JavaScript into the page. It should always be located after the body tag as soon as possible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
......&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are checking whether or not we need to print the header for the page. There are three checks we need to make here:&lt;br /&gt;
# &#039;&#039;&#039;$PAGE-&amp;gt;heading&#039;&#039;&#039; : This checks to make sure that there is a heading for the page. This will have been set by the script and normally describes the page in a couple of words.&lt;br /&gt;
# &#039;&#039;&#039;empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;])&#039;&#039;&#039; : Now this check is looking at the layout options that we set in our config.php file. It is looking to see if the layout set &#039;nonavbar&#039; =&amp;gt; true.&lt;br /&gt;
# &#039;&#039;&#039;$PAGE-&amp;gt;has_navbar()&#039;&#039;&#039; The third check is to check with the page whether it has a navigation bar to display.&lt;br /&gt;
If either there is a heading for this page or there is a navigation bar to display then we will display a heading.&lt;br /&gt;
&lt;br /&gt;
Leading on from this lets assume that there is a header to print.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
    .....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line is simply saying if the page has a heading print it. In this case we run the first check above again just to make sure there is a heading, we then open a heading tag that we choose and ask the page to print the heading.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
    echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
    if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
        echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
    }&lt;br /&gt;
    echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are looking to print the menu and content that you see at the top of the page (usually to the right). We start by getting Moodle to print the login information for the current user. If the user is logged in this will be their name and a link to their profile, if not then it will be a link to login.&lt;br /&gt;
&lt;br /&gt;
Next we check our page options to see whether a language menu should be printed. If in the layout definition within config.php it sets &#039;&#039;&#039;langmenu =&amp;gt; true&#039;&#039;&#039; then we will print the language menu, a drop down box that lets the user change the language that Moodle displays in.&lt;br /&gt;
&lt;br /&gt;
Finally the page also has a heading menu that can be printed. This heading menu is special HTML that the page you are viewing wants to add. It can be anything from drop down boxes to buttons and any number of each.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The final part of the header.&lt;br /&gt;
&lt;br /&gt;
Here we want to print the navigation bar for the page if there is one. To find out if there is one we run checks number 2 and 3 again and proceed if they pass.&lt;br /&gt;
&lt;br /&gt;
Assuming there is a header then there are two things that we need to print. The first is the navigation bar. This is a component that the OUTPUT library knows about. The second is a button to show on the page.&lt;br /&gt;
&lt;br /&gt;
In both cases we choose to wrap them in a div tag with a class attribute to enable theming on those elements.&lt;br /&gt;
&lt;br /&gt;
Well that is it for the header. There is a lot of PHP compared to the other sections of the layout file but it does not change and can be copied and pasted between themes.&lt;br /&gt;
&lt;br /&gt;
===The page content===&lt;br /&gt;
&lt;br /&gt;
I am going with the default two block regions plus the main content.&lt;br /&gt;
&lt;br /&gt;
Because I have based this theme and layout file on the base theme the HTML looks a little intense. This is because it is a floating div layout where the content comes first and then we get the columns (even though one column will be to the left of the content.) Don&#039;t worry too much about it. When it comes to writing your own theme you can go about it as you choose.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page-content&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;region-main-box&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;region-post-box&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;div id=&amp;quot;region-main-wrap&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-main&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&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;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-pre&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
                &lt;br /&gt;
                &amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-post&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;?php } ?&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;
In regards to PHP this section is very easy. There are only three lines for the whole section one to get the main content and one for each block region.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line prints the main content for the page.&lt;br /&gt;
PLEASE NOTE: In Moodle 2.2 onwards &amp;quot;core_renderer::MAIN_CONTENT_TOKEN&amp;quot; changed to &amp;quot;$OUTPUT-&amp;gt;main_content()&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
These lines of code check the variables we created earlier on to decide whether we should show the pre block region. If you try to display a block region that isn&#039;t there or has no content then Moodle will give you an error message so these lines are very important.&lt;br /&gt;
&lt;br /&gt;
For those who get an error message if it is &amp;quot;unknown block region side-pre&amp;quot; or &amp;quot;unknown block region side-post&amp;quot; then this is the issue you are experiencing. Simply add the following lines and all will be fine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This line gets all of the blocks and more particularly the content for the block region &#039;&#039;&#039;side-pre&#039;&#039;&#039;. This block region will be displayed to the left of the content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Again we should make this check for every block region as there are some pages that have no blocks what-so-ever.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here we are getting the other block region &#039;&#039;&#039;side-post&#039;&#039;&#039; which will be displayed to the right of the content.&lt;br /&gt;
&lt;br /&gt;
===The page footer===&lt;br /&gt;
Here we want to print the footer for the page, any content required by Moodle, and then close the last tags.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html() ?&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;
The section of code is responsible for printing the footer for the page.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first thing we do before printing the footer is check that we actually want to print it. This is done by checking the options for the layout as defined in the config.php file. If &#039;&#039;&#039;nofooter =&amp;gt; true&#039;&#039;&#039; is set the we don&#039;t want to print the footer and should skip over this body of code.&lt;br /&gt;
&lt;br /&gt;
Assuming we want to print a footer we proceed to create a div to house its content and then print the bits of the content that will make it up.&lt;br /&gt;
There are four things that the typical page footer will want to print:&lt;br /&gt;
; echo page_doc_link(get_string(&#039;moodledocslink&#039;)) : This will print a link to the Moodle.org help page for this particular page.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;login_info(); : This is the same as at the top of the page and will print the login information for the current user.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;home_link(); : This prints a link back to the Moodle home page for this site.&lt;br /&gt;
; echo $OUTPUT-&amp;gt;standard_footer_html(); : This prints special HTML that is determined by the settings for the site. Things such as performance information or debugging will be printed by this line if they are turned on.&lt;br /&gt;
&lt;br /&gt;
And the final line of code for our layout file is:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is one of the most important lines of code in the layout file. It asks Moodle to print any required content into the page, and there will likely be a lot although most of it will not be visual.&lt;br /&gt;
&lt;br /&gt;
It will instead be things such as inline scripts and JavaScript files required to go at the bottom of the page. If you forget this line its likely no JavaScript will work!&lt;br /&gt;
&lt;br /&gt;
We&#039;ve now written our layout file and it is all set to go. The complete source is below for reference. Remember if you want more practical examples simply look at the layout files located within the layout directory of other themes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$hassidepre = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-pre&#039;, $OUTPUT);&lt;br /&gt;
$hassidepost = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-post&#039;, $OUTPUT);&lt;br /&gt;
echo $OUTPUT-&amp;gt;doctype() ?&amp;gt;&lt;br /&gt;
&amp;lt;html &amp;lt;?php echo $OUTPUT-&amp;gt;htmlattributes() ?&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;title; ?&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;favicon&#039;, &#039;theme&#039;)?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;?php echo $OUTPUT-&amp;gt;standard_head_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyid); ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php p($PAGE-&amp;gt;bodyclasses); ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_top_of_body_html() ?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($PAGE-&amp;gt;heading || (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar())) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-header&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php if ($PAGE-&amp;gt;heading) { ?&amp;gt;&lt;br /&gt;
        &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
            echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
            if (!empty($PAGE-&amp;gt;layout_options[&#039;langmenu&#039;])) {&lt;br /&gt;
                echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
            }&lt;br /&gt;
            echo $PAGE-&amp;gt;headingmenu&lt;br /&gt;
        ?&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
        &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nonavbar&#039;]) &amp;amp;&amp;amp; $PAGE-&amp;gt;has_navbar()) { ?&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&amp;quot;navbar clearfix&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;breadcrumb&amp;quot;&amp;gt;&amp;lt;?php echo $OUTPUT-&amp;gt;navbar(); ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&amp;quot;navbutton&amp;quot;&amp;gt; &amp;lt;?php echo $PAGE-&amp;gt;button; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-content&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;region-main-box&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;div id=&amp;quot;region-post-box&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-main-wrap&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div id=&amp;quot;region-main&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                            &amp;lt;?php echo core_renderer::MAIN_CONTENT_TOKEN ?&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;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-pre&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
                &lt;br /&gt;
                &amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
                &amp;lt;div id=&amp;quot;region-post&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;?php } ?&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;
&lt;br /&gt;
    &amp;lt;?php if (empty($PAGE-&amp;gt;layout_options[&#039;nofooter&#039;])) { ?&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;home_link();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;standard_footer_html();&lt;br /&gt;
        ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php echo $OUTPUT-&amp;gt;standard_end_of_body_html() ?&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;
==Adding some CSS==&lt;br /&gt;
With config.php and standard.php both complete the theme is now usable and starting to look like a real theme, however if you change to it using the theme selector you will notice that it still lacks any style.&lt;br /&gt;
&lt;br /&gt;
This of course is where CSS comes in. When writing code Moodle developers are strongly encouraged to not use inline styles anywhere. This is fantastic for us as themers because there is nothing (or at least very little) in Moodle that cannot be styled using CSS.&lt;br /&gt;
&lt;br /&gt;
===Moodle CSS basics===&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.0 all of the CSS for the whole of Moodle is delivered all of the time! This was done for performance reasons. Moodle now reads in all of the CSS, combines it into one file, shrinks it removing any white space, caches it, and then delivers it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What this means for you as a themer?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You will need to write good CSS that won&#039;t clash with any other CSS within Moodle.&lt;br /&gt;
&lt;br /&gt;
Moodle is so big and complex,there is no way to ensure that classes don&#039;t get reused. What we can control however is the classes and id that get added to the body tag for every page. When writing CSS it is highly encouraged to make full use of these body classes, using them will help ensure the CSS you write has the least chance of causing conflicts.&lt;br /&gt;
&lt;br /&gt;
You should also take the time to look at how the Moodle themes use CSS. Look at their use of the body classes and how they separate the CSS for the theme into separate files based on the region of Moodle it applies to.&lt;br /&gt;
&lt;br /&gt;
Check out [[Themes 2.0|Themes 2.0]] and [[CSS coding style]] for more information about writing good CSS.&lt;br /&gt;
&lt;br /&gt;
===Starting to write excitement.css===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
a {&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.addcoursebutton .singlebutton {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1.headermain {&lt;br /&gt;
    color: #fff;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.main {&lt;br /&gt;
    border-bottom: 3px solid #013D6A;&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock {&lt;br /&gt;
    font-size: 18pt;&lt;br /&gt;
    margin-top: 0;&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header {&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header .headermenu {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#page-header .headermenu a {&lt;br /&gt;
    color: #FDFF2A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar {&lt;br /&gt;
    padding-left: 1em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.breadcrumb li {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.breadcrumb li a {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block {&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .header .title {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .header .title .block_action input {&lt;br /&gt;
    background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .content {&lt;br /&gt;
    border: 1px solid #000;&lt;br /&gt;
    padding: 5px;&lt;br /&gt;
    background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block .content .block_tree p {&lt;br /&gt;
    font-size: 80%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer {&lt;br /&gt;
    text-align: center;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform {&lt;br /&gt;
    margin-left: 5%;&lt;br /&gt;
    width: 90%;&lt;br /&gt;
    font-size: 9pt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform #adminsearchquery {&lt;br /&gt;
    width: 95%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .calendar-controls a {&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
    font-weight: bold;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar td {&lt;br /&gt;
    border-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {&lt;br /&gt;
    color: #FFF;&lt;br /&gt;
    background-color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .day a {&lt;br /&gt;
    color: #FFF000;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays th {&lt;br /&gt;
    border-width: 0;&lt;br /&gt;
    font-weight: bold;&lt;br /&gt;
    color: #013D6A;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays abbr {&lt;br /&gt;
    border-width: 0;&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
[[image:Learn_to_theme_02.jpg|400px|thumb|Excitement theme screenshot]]&lt;br /&gt;
This isn&#039;t all of the CSS for the theme, but just enough to style the front page when the user is not logged in.&lt;br /&gt;
Remember this theme extends the base theme so there is already CSS for layout as well.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* The CSS is laid out in a single line format. This is done within the core themes for Moodle. It makes it quicker to read the selectors and see what is being styled.&lt;br /&gt;
* I have written my selectors to take into account the structure of the HTML (more than just the one tag I want to style). This helps further to reduce the conflicts that I may encounter.&lt;br /&gt;
* I use generic classes like &#039;&#039;.sideblock&#039;&#039; only where I want to be generic, as soon as I want to be specific I use the unique classes such as &#039;&#039;.block_calendar_month&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using images within CSS===&lt;br /&gt;
&lt;br /&gt;
I will add two image files to the pix directory of my theme:&lt;br /&gt;
; /theme/excitement/pix/background.png : This will be the background image for my theme.&lt;br /&gt;
; /theme/excitement/pix/gradient.jpg : This will be a gradient I use for the header and headings.&lt;br /&gt;
I quickly created both of these images using gimp and simply saved them to the pix directory.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
html {&lt;br /&gt;
    background-image: url([[pix:theme|background]]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock,&lt;br /&gt;
#page-header,&lt;br /&gt;
.sideblock,&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {&lt;br /&gt;
    background-image: url([[pix:theme|gradient]]);&lt;br /&gt;
    background-repeat: repeat-x;&lt;br /&gt;
    background-color: #0273C8;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
[[image:Learn_to_theme_03.jpg‎|400px|thumb|Excitement theme screenshot]]&lt;br /&gt;
The CSS above is the two new rules that I had to write to use my images within CSS.&lt;br /&gt;
&lt;br /&gt;
The first rule sets the background image for the page to background.png&lt;br /&gt;
&lt;br /&gt;
The second rule sets the background for headings, and the sideblocks to use gradient.jpg&lt;br /&gt;
&lt;br /&gt;
You will notice that I did not need to write a path to the image. This is because Moodle has this special syntax that can be used and will be replaced when the CSS is parsed before delivery.&lt;br /&gt;
The advantage of using this syntax over writing the path in is that the path may change depending on where you are or what theme is being used.&lt;br /&gt;
&lt;br /&gt;
Other themers may choose to extend your theme with their own; if you use this syntax then all they need to do to override the image is to create one with the same name in their themes directory.&lt;br /&gt;
&lt;br /&gt;
You will also notice that I don&#039;t need to add the image files extension. This is because Moodle is smart enough to work out what extension the file uses. It also allows themers to override images with different formats.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot; /&amp;gt;&lt;br /&gt;
The following is the complete CSS for my theme:&lt;br /&gt;
&amp;lt;div style=&amp;quot;overflow:auto;height:860px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
a {text-decoration: none;}&lt;br /&gt;
.addcoursebutton .singlebutton {text-align: center;}&lt;br /&gt;
&lt;br /&gt;
h1.headermain {color: #fff;}&lt;br /&gt;
h2.main {border-bottom: 3px solid #013D6A;color: #013D6A;text-align: center;}&lt;br /&gt;
h2.headingblock {font-size: 18pt;margin-top: 0;background-color: #013D6A;color: #FFF;text-align: center;}&lt;br /&gt;
#page-header {background-color: #013D6A;border-bottom:5px solid #013D6A;}&lt;br /&gt;
#page-header .headermenu  {color: #FFF;}&lt;br /&gt;
#page-header .headermenu a {color: #FDFF2A;}&lt;br /&gt;
&lt;br /&gt;
.sideblock {background-color: #013D6A;}&lt;br /&gt;
.sideblock .header .title {color: #FFF;}&lt;br /&gt;
.sideblock .header .title .block_action input {background-color: #FFF;}&lt;br /&gt;
.sideblock .content {border: 1px solid #000;padding: 5px;background-color: #FFF;}&lt;br /&gt;
.sideblock .content .block_tree p {font-size: 80%;}&lt;br /&gt;
&lt;br /&gt;
.block_settings_navigation_tree .content .footer {text-align: center;}&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform {margin-left: 5%;width: 90%;font-size: 9pt;}&lt;br /&gt;
.block_settings_navigation_tree .content .footer .adminsearchform #adminsearchquery {width: 95%;}&lt;br /&gt;
&lt;br /&gt;
.block_calendar_month .content .calendar-controls a {color: #013D6A;font-weight: bold;}&lt;br /&gt;
.block_calendar_month .content .minicalendar td {border-color: #FFF;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {color: #FFF;background-color: #013D6A;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .day a {color: #FFF000;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays th {border-width: 0;font-weight: bold;color: #013D6A;}&lt;br /&gt;
.block_calendar_month .content .minicalendar .weekdays abbr {border-width: 0;text-decoration: none;}&lt;br /&gt;
&lt;br /&gt;
html {background-image:url([[pix:theme|background]]);}&lt;br /&gt;
&lt;br /&gt;
h2.headingblock,&lt;br /&gt;
#page-header,&lt;br /&gt;
.sideblock,&lt;br /&gt;
.block_calendar_month .content .minicalendar .day {background-image:url([[pix:theme|gradient]]);&lt;br /&gt;
   background-repeat:repeat-x;background-color: #0273C8;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding a screenshot and favicon==&lt;br /&gt;
The final thing to do at this point is add both a screenshot for this theme as well as a favicon for it.&lt;br /&gt;
The screenshot will be shown in the theme selector screen and should be named &#039;&#039;screenshot.jpg&#039;&#039;.&lt;br /&gt;
The favicon will be used when someone bookmarks this page.&lt;br /&gt;
Both images should be located in your themes pix directory as follows:&lt;br /&gt;
* /theme/excitement/pix/screenshot.jpg&lt;br /&gt;
* /theme/excitement/pix/favicon.ico&lt;br /&gt;
&lt;br /&gt;
In the case of my theme I have taken a screenshot and added it to that directory, and because I don&#039;t really want to do anything special with the favicon I have copied it from /theme/base/pix/favicon.ico so that at least it will be recognisable as Moodle.&lt;br /&gt;
&lt;br /&gt;
[[es:Desarollo:Temas 2.0 creando tu primer tema]]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Output_components&amp;diff=46591</id>
		<title>Output components</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Output_components&amp;diff=46591"/>
		<updated>2014-10-27T01:31:57Z</updated>

		<summary type="html">&lt;p&gt;Jethac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
A list of renderable components to be used with [[Output renderers|output renderers]].&lt;br /&gt;
&lt;br /&gt;
== User-related components ==&lt;br /&gt;
=== user_picture ===&lt;br /&gt;
An avatar for a given &#039;&#039;&#039;user&#039;&#039;&#039; object, which can be rendered after being constructed directly:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$userpic1 = new user_picture($USER);&lt;br /&gt;
$OUTPUT-&amp;gt;render($userpic1);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Or by using a helper method in the core renderer (preferred):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$options = array( &amp;quot;visibletoscreenreaders&amp;quot; =&amp;gt; false );&lt;br /&gt;
$userpic2 = $OUTPUT-&amp;gt;user_picture($USER, $options);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The user object should have the following fields: &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
id&lt;br /&gt;
picture&lt;br /&gt;
imagealt&lt;br /&gt;
firstname&lt;br /&gt;
lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
If the object does not have these fields, the db will be queried with significant performance implications. A list of these fields can be obtained from user_picture::fields() for the purposes of getting values ahead of time if necessary.&lt;br /&gt;
&lt;br /&gt;
The following options can be set on the user_picture, either by changing each field after construction or by passing in an associative array as the second argument.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$userpic-&amp;gt;courseid = $this-&amp;gt;page-&amp;gt;course-&amp;gt;id; // course id of user profile in link&lt;br /&gt;
$userpic-&amp;gt;size = 35; // size of image&lt;br /&gt;
$userpic-&amp;gt;link = true; // make image clickable - the link leads to user profile&lt;br /&gt;
$userpic-&amp;gt;popup = false; // open in popup&lt;br /&gt;
$userpic-&amp;gt;alttext = true; // add image alt attribute&lt;br /&gt;
$userpic-&amp;gt;class = &amp;quot;userpicture&amp;quot;; // image class attribute&lt;br /&gt;
$userpic-&amp;gt;visibletoscreenreaders = true; // whether to be visible to screen readers&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Output_components&amp;diff=46590</id>
		<title>Output components</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Output_components&amp;diff=46590"/>
		<updated>2014-10-27T01:31:31Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* user_picture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
A list of renderable components to be used with [[Output renderers||output renderers]].&lt;br /&gt;
&lt;br /&gt;
== User-related components ==&lt;br /&gt;
=== user_picture ===&lt;br /&gt;
An avatar for a given &#039;&#039;&#039;user&#039;&#039;&#039; object, which can be rendered after being constructed directly:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$userpic1 = new user_picture($USER);&lt;br /&gt;
$OUTPUT-&amp;gt;render($userpic1);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Or by using a helper method in the core renderer (preferred):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$options = array( &amp;quot;visibletoscreenreaders&amp;quot; =&amp;gt; false );&lt;br /&gt;
$userpic2 = $OUTPUT-&amp;gt;user_picture($USER, $options);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The user object should have the following fields: &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
id&lt;br /&gt;
picture&lt;br /&gt;
imagealt&lt;br /&gt;
firstname&lt;br /&gt;
lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
If the object does not have these fields, the db will be queried with significant performance implications. A list of these fields can be obtained from user_picture::fields() for the purposes of getting values ahead of time if necessary.&lt;br /&gt;
&lt;br /&gt;
The following options can be set on the user_picture, either by changing each field after construction or by passing in an associative array as the second argument.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$userpic-&amp;gt;courseid = $this-&amp;gt;page-&amp;gt;course-&amp;gt;id; // course id of user profile in link&lt;br /&gt;
$userpic-&amp;gt;size = 35; // size of image&lt;br /&gt;
$userpic-&amp;gt;link = true; // make image clickable - the link leads to user profile&lt;br /&gt;
$userpic-&amp;gt;popup = false; // open in popup&lt;br /&gt;
$userpic-&amp;gt;alttext = true; // add image alt attribute&lt;br /&gt;
$userpic-&amp;gt;class = &amp;quot;userpicture&amp;quot;; // image class attribute&lt;br /&gt;
$userpic-&amp;gt;visibletoscreenreaders = true; // whether to be visible to screen readers&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Output_components&amp;diff=46589</id>
		<title>Output components</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Output_components&amp;diff=46589"/>
		<updated>2014-10-27T01:30:52Z</updated>

		<summary type="html">&lt;p&gt;Jethac: Created page with &amp;quot;{{Work in progress}}  A list of renderable components to be used with output renderers.  == User-related components == === user_picture === An avatar for...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
A list of renderable components to be used with [[Output renderers||output renderers]].&lt;br /&gt;
&lt;br /&gt;
== User-related components ==&lt;br /&gt;
=== user_picture ===&lt;br /&gt;
An avatar for a given *user* object, which can be rendered after being constructed directly:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$userpic1 = new user_picture($USER);&lt;br /&gt;
$OUTPUT-&amp;gt;render($userpic1);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Or by using a helper method in the core renderer (preferred):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$options = array( &amp;quot;visibletoscreenreaders&amp;quot; =&amp;gt; false );&lt;br /&gt;
$userpic2 = $OUTPUT-&amp;gt;user_picture($USER, $options);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The user object should have the following fields: &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
id&lt;br /&gt;
picture&lt;br /&gt;
imagealt&lt;br /&gt;
firstname&lt;br /&gt;
lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
If the object does not have these fields, the db will be queried with significant performance implications. A list of these fields can be obtained from user_picture::fields() for the purposes of getting values ahead of time if necessary.&lt;br /&gt;
&lt;br /&gt;
The following options can be set on the user_picture, either by changing each field after construction or by passing in an associative array as the second argument.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$userpic-&amp;gt;courseid = $this-&amp;gt;page-&amp;gt;course-&amp;gt;id; // course id of user profile in link&lt;br /&gt;
$userpic-&amp;gt;size = 35; // size of image&lt;br /&gt;
$userpic-&amp;gt;link = true; // make image clickable - the link leads to user profile&lt;br /&gt;
$userpic-&amp;gt;popup = false; // open in popup&lt;br /&gt;
$userpic-&amp;gt;alttext = true; // add image alt attribute&lt;br /&gt;
$userpic-&amp;gt;class = &amp;quot;userpicture&amp;quot;; // image class attribute&lt;br /&gt;
$userpic-&amp;gt;visibletoscreenreaders = true; // whether to be visible to screen readers&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Deprecated_functions_in_2.0&amp;diff=46588</id>
		<title>Deprecated functions in 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Deprecated_functions_in_2.0&amp;diff=46588"/>
		<updated>2014-10-27T01:12:21Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* print_user_picture (0) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THIS PAGE IS OUTDATED, DO NOT USE!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page lists all functions that have been deprecated between 1.9 and 2.0, with instructions on how to upgrade your code. A count of remaining function calls in core is kept next to each function name.&lt;br /&gt;
&lt;br /&gt;
== General notes ==&lt;br /&gt;
&lt;br /&gt;
The following functions have been arranged in alphabetical order, although some of them are very closely related to each other. The number of occurrences of these function calls at the time of writing are indicated in parentheses.&lt;br /&gt;
&lt;br /&gt;
== Functions to migrate ==&lt;br /&gt;
=== button_to_popup_window (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
button_to_popup_window($url, $name, $linkname, $height, $width, $title, $options, $return, $id, $class);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$form = new html_form();&lt;br /&gt;
$form-&amp;gt;button-&amp;gt;text = $linkname;&lt;br /&gt;
$form-&amp;gt;button-&amp;gt;title = $title;&lt;br /&gt;
$form-&amp;gt;button-&amp;gt;id = $id;&lt;br /&gt;
$form-&amp;gt;url = $url;&lt;br /&gt;
$form-&amp;gt;add_class($class);&lt;br /&gt;
$form-&amp;gt;button-&amp;gt;add_action(new popup_action(&#039;click&#039;, $url, $name, $options));&lt;br /&gt;
echo $OUTPUT-&amp;gt;button($form);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: popup parameters ($options) &#039;&#039;&#039;must&#039;&#039;&#039; be prepared as an associative array, not a string as previously. Simply reusing the $options param previously passed to button_to_popup_window() will not work. The $height and $width params are also part of the popup params. See lib/deprecatedlib.php for an example of how the legacy function call is handled.&lt;br /&gt;
&lt;br /&gt;
=== choose_from_menu (1) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
choose_from_menu($options, $name, $selected, $nothing, $script, $nothingvalue, $return, $disabled, $tabindex, $id, $listbox, $multiple, $class);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$attributes[&#039;disabled&#039;] = $disabled;&lt;br /&gt;
$attributes[&#039;tabindex&#039;] = $tabindex;&lt;br /&gt;
$attributes[&#039;multiple&#039;] = $multiple;&lt;br /&gt;
$attributes[&#039;class&#039;] = $class;&lt;br /&gt;
$attributes[&#039;id&#039;] = $id;&lt;br /&gt;
&lt;br /&gt;
echo html_writer::select($options, $name, $selected, array($nothingvalue=&amp;gt;$nothing), $attributes);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== choose_from_menu_nested (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
choose_from_menu_nested($options, $name, $selected, $nothing, $script, $nothingvalue, $return, $disabled, $tabindex);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$select = moodle_select::make($options, $name, $selected);&lt;br /&gt;
$select-&amp;gt;tabindex = $tabindex;&lt;br /&gt;
$select-&amp;gt;disabled = $disabled;&lt;br /&gt;
$select-&amp;gt;nothingvalue = $nothingvalue;&lt;br /&gt;
$select-&amp;gt;nested = true;&lt;br /&gt;
&lt;br /&gt;
echo $OUTPUT-&amp;gt;select($select);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
#The lang string &amp;quot;choose&amp;quot; is no longer used, in favour of &amp;quot;choosedots&amp;quot;.&lt;br /&gt;
#The $script param is no longer supported. Please use component::add_action() instead.&lt;br /&gt;
&lt;br /&gt;
=== choose_from_menu_yesno (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
choose_from_menu_yesno($name, $selected, $script, $return, $disabled, $tabindex);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$select = moodle_select::make_yes_no($name, $selected);&lt;br /&gt;
$select-&amp;gt;disabled = $disabled;&lt;br /&gt;
$select-&amp;gt;tabindex = $tabindex;&lt;br /&gt;
echo $OUTPUT-&amp;gt;select($select);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: The $script param has been dropped, you need to use component::add_action() instead.&lt;br /&gt;
&lt;br /&gt;
=== choose_from_radio (0) ===&lt;br /&gt;
&lt;br /&gt;
=== close_window_button (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
close_window_button($name, $return, $reloadopener);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;close_window_button(get_string($name));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: You must pass a language string already processed by get_string().&lt;br /&gt;
&lt;br /&gt;
=== print_continue (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_continue($link, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;continue_button($link);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== doc_link (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
doc_link($path, $text, $iconpath);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;doc_link($path, $text, $iconpath);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: This is not for general use, do not confuse with help_icon()&lt;br /&gt;
&lt;br /&gt;
=== formerr (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
formerr($string);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;error_text($error);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== helpbutton (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
helpbutton($page, $title, $module, $image, $linktext, $text, $return, $imagetext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$helpicon = new help_icon();&lt;br /&gt;
$helpicon-&amp;gt;page = $page; // required&lt;br /&gt;
$helpicon-&amp;gt;text = $title; // required&lt;br /&gt;
$helpicon-&amp;gt;module = $module; // defaults to &#039;moodle&#039;&lt;br /&gt;
$helpicon-&amp;gt;linktext = $linktext;&lt;br /&gt;
&lt;br /&gt;
echo $OUTPUT-&amp;gt;help_icon($helpicon);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== link_to_popup_window (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
link_to_popup_window($url, $name, $linkname, $height, $width, $title, $options, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$link = html_link::make($url, $linkname);&lt;br /&gt;
$link-&amp;gt;title = $title; // optional&lt;br /&gt;
$options[&#039;height&#039;] = $height; // optional&lt;br /&gt;
$options[&#039;width&#039;] = $width; // optional&lt;br /&gt;
$link-&amp;gt;add_action(new popup_action(&#039;click&#039;, $url, $name, $options));&lt;br /&gt;
echo $OUTPUT-&amp;gt;link($link);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: popup parameters ($options) &#039;&#039;&#039;must&#039;&#039;&#039; be prepared as an associative array, not a string as previously. Simply reusing the $options param previously passed to link_to_popup_window() will not work. See lib/deprecatedlib.php for an example of how the legacy function call is handled.&lt;br /&gt;
&lt;br /&gt;
=== notice_yesno (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
notice_yesno($message, $linkyes, $linkno, $optionsyes, $optionsno, $methodyes, $methodno);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code (simplest form):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;confirm($message, $linkyes, $linkno);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
New code (with options in arrays):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;confirm($message, new moodle_url($linkyes, $optionsyes), new moodle_url($linkno, $optionsno));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
New code (if the &amp;quot;get&amp;quot; method is required):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$formcontinue = new single_button($linkyes, $optionsyes, get_string(&#039;yes&#039;), $methodyes);&lt;br /&gt;
$formcancel = new single_button($linkno, $optionsno, get_string(&#039;no&#039;), $methodno);&lt;br /&gt;
echo $OUTPUT-&amp;gt;confirm($message, $formcontinue, $formcancel);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== notify (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
notify($message, $classes, $align, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;notification($message, $classes=&#039;&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: Use a CSS rule for alignment.&lt;br /&gt;
&lt;br /&gt;
=== popup_form (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
popup_form($baseurl, $options, $formid, $selected, $nothing, $help, $helptext, $return, $targetwindow, $selectlabel, $optionsextra, $submitvalue, $disabled, $showbutton);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// if $baseurl == &#039;http://domain.com/index.php?var1=1&amp;amp;amp;var2=&#039;&lt;br /&gt;
$select = html_select::make_popup_form(&#039;http://domain.com/index.php?var1=1&#039;, &#039;var2&#039;, $options, $formid, $selected);&lt;br /&gt;
$select-&amp;gt;disabled = $disabled; // optional&lt;br /&gt;
$select-&amp;gt;set_label($selectlabel, $select-&amp;gt;id); // optional, set to false if no &amp;quot;nothing&amp;quot; option is desired (when $selectlabel == &#039;&#039; in original call)&lt;br /&gt;
$select-&amp;gt;set_help_icon($help, $helptext); // optional&lt;br /&gt;
$select-&amp;gt;form-&amp;gt;button-&amp;gt;text = $submitvalue; // optional&lt;br /&gt;
&lt;br /&gt;
echo $OUTPUT-&amp;gt;select($select);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
*The $optionsextra param is not supported. If your code uses it, you should find another way to add extra params to your &amp;lt;option&amp;gt; tags without using this horrible hack which usually includes inline JS or CSS.&lt;br /&gt;
&lt;br /&gt;
=== print_arrow (15) ===&lt;br /&gt;
=== print_box* (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_box($message, $classes, $ids, $return);&lt;br /&gt;
print_box_start($classes, $ids, $return);&lt;br /&gt;
print_box_end();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;box($message, $classes, $ids);&lt;br /&gt;
echo $OUTPUT-&amp;gt;box_start($classes, $ids);&lt;br /&gt;
echo $OUTPUT-&amp;gt;box_end();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== print_checkbox (10) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_checkbox($name, $value, $checked, $label, $alt, $script, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$checkbox = new html_select_option();&lt;br /&gt;
$checkbox-&amp;gt;value = $value; // Required&lt;br /&gt;
$checkbox-&amp;gt;selected = $checked;&lt;br /&gt;
$checkbox-&amp;gt;text = $label;&lt;br /&gt;
$checkbox-&amp;gt;label-&amp;gt;text = $label;&lt;br /&gt;
$checkbox-&amp;gt;alt = $alt;&lt;br /&gt;
                                               &lt;br /&gt;
echo $OUTPUT-&amp;gt;checkbox($checkbox, $name);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: html_select_option is a component that can be rendered as a select &amp;lt;option&amp;gt;, a radio button or a checkbox. It holds sufficient information to render all these elements, except the $name variable which is attached to a moodle_select component. This is why we pass the $name string to $OUTPUT-&amp;gt;checkbox().&lt;br /&gt;
&lt;br /&gt;
=== print_container (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_container($message, $clearfix, $classes, $idbase, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if ($clearfix) {&lt;br /&gt;
    $classes .= &#039; clearfix&#039;;&lt;br /&gt;
}&lt;br /&gt;
echo $OUTPUT-&amp;gt;container($message, $classes, $idbase);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== print_date_selector (0) ===&lt;br /&gt;
&lt;br /&gt;
=== print_footer (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_footer($course, $usercourse, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;footer();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notes: No parameters are required.&lt;br /&gt;
&lt;br /&gt;
=== print_header (501) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_header($title, $heading, $navigation, $focus, $meta, $cache, $button, $menu, $usexml, $bodytags, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;set_heading($heading); // Required&lt;br /&gt;
$PAGE-&amp;gt;set_title($title);&lt;br /&gt;
$PAGE-&amp;gt;set_cacheable($cache);&lt;br /&gt;
$PAGE-&amp;gt;set_focuscontrol($focus);&lt;br /&gt;
$PAGE-&amp;gt;set_button($button);&lt;br /&gt;
$PAGE-&amp;gt;navbar-&amp;gt;add($nav_entry[0]);&lt;br /&gt;
$PAGE-&amp;gt;navbar-&amp;gt;add($nav_entry[1]);&lt;br /&gt;
&lt;br /&gt;
echo $OUTPUT-&amp;gt;header();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: Navigation code is being rewritten, this doc will then be updated with the new usage.&lt;br /&gt;
&lt;br /&gt;
=== print_heading_with_help (0) ===&lt;br /&gt;
&lt;br /&gt;
=== print_heading (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_heading($text, $align, $size, $class, $return, $id);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;heading($text, $size, $class, $id);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: Use a CSS class rule to control alignment.&lt;br /&gt;
&lt;br /&gt;
=== print_heading_block (0) ===&lt;br /&gt;
&lt;br /&gt;
=== print_headline (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_headline($text, $size);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;heading($text, $size);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== print_paging_bar (2) ===&lt;br /&gt;
&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_paging_bar($totalcount, $page, $perpage, $baseurl, $pagevar, $nocurr, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$pagingbar = new moodle_paging_bar();&lt;br /&gt;
$pagingbar-&amp;gt;totalcount = $totalcount; // Required&lt;br /&gt;
$pagingbar-&amp;gt;page = $page; // Required&lt;br /&gt;
$pagingbar-&amp;gt;perpage = $perpage; // Required&lt;br /&gt;
$pagingbar-&amp;gt;baseurl = $baseurl; // Required&lt;br /&gt;
$pagingbar-&amp;gt;pagevar = $pagevar;&lt;br /&gt;
echo $OUTPUT-&amp;gt;paging_bar($pagingbar);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: The last two instances of print_paging_bar are found in the old tablelib, which will soon be deprecated.&lt;br /&gt;
&lt;br /&gt;
Note: $nocurr has been dropped. Current page number is never displayed as a link&lt;br /&gt;
&lt;br /&gt;
=== print_scale_menu_helpbutton (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_scale_menu_helpbutton($courseid, $scale);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
echo $OUTPUT-&amp;gt;help_button(help_button::make_scale_menu($courseid, $scale));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== print_side_block (4) ===&lt;br /&gt;
=== print_single_button (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_single_button($link, $options, $label, $method, $notusedanymore, $return, $tooltip, $disabled, $jsconfirmmessage, $formid)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$form = new html_form();&lt;br /&gt;
$form-&amp;gt;url = new moodle_url($link, $options); // Required&lt;br /&gt;
$form-&amp;gt;button = new html_button();&lt;br /&gt;
$form-&amp;gt;button-&amp;gt;text = $label; // Required&lt;br /&gt;
$form-&amp;gt;button-&amp;gt;disabled = $disabled;&lt;br /&gt;
$form-&amp;gt;button-&amp;gt;title = $tooltip;&lt;br /&gt;
$form-&amp;gt;method = $method;&lt;br /&gt;
$form-&amp;gt;id = $formid;&lt;br /&gt;
&lt;br /&gt;
if ($jsconfirmmessage) {&lt;br /&gt;
    $confirmaction = new component_action(&#039;click&#039;, &#039;confirm_dialog&#039;, array(&#039;message&#039; =&amp;gt; $jsconfirmmessage));&lt;br /&gt;
    $form-&amp;gt;button-&amp;gt;add_action($confirmaction);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$output = $OUTPUT-&amp;gt;button($form);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== print_spacer (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_spacer($height, $width, $br, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$spacer = new html_image();&lt;br /&gt;
$spacer-&amp;gt;height = $height;&lt;br /&gt;
$spacer-&amp;gt;width = $width;&lt;br /&gt;
echo $OUTPUT-&amp;gt;spacer($spacer);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: The $br attribute has been dropped. You can simply add a line break manually if you need one.&lt;br /&gt;
&lt;br /&gt;
=== print_table (0) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$table = new stdClass();&lt;br /&gt;
$table-&amp;gt;class = &#039;mytable&#039;;&lt;br /&gt;
$table-&amp;gt;head  = array(&#039;Firstname&#039;, &#039;Lastname&#039;);&lt;br /&gt;
$table-&amp;gt;rowclasses = array();&lt;br /&gt;
// (other table properties here)&lt;br /&gt;
$table-&amp;gt;data = array(array(...),array(...),array(...));&lt;br /&gt;
print_table($table, $return);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$table = new html_table();&lt;br /&gt;
$table-&amp;gt;set_classes(&#039;mytable&#039;); // note the new style of setting CSS class&lt;br /&gt;
$table-&amp;gt;head = array(&#039;First name&#039;, &#039;Last name&#039;);&lt;br /&gt;
$table-&amp;gt;colclasses = array(&#039;name fname&#039;,&#039;name lname&#039;);&lt;br /&gt;
$table-&amp;gt;rowclasses = array();&lt;br /&gt;
// (other table properties here)&lt;br /&gt;
$table-&amp;gt;data = array(array(...),array(...),array(...));&lt;br /&gt;
echo $OUTPUT-&amp;gt;table($newtable);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notes: The new html_table object has the same member variables as the one originally used by print_table(), but has additional, required methods. You must map the old $table object to the new html_table object, as demonstrated above and in lib/deprecatedlib.php (see old print_table function).&lt;br /&gt;
&lt;br /&gt;
=== print_textarea (55) ===&lt;br /&gt;
=== print_textfield (0) ===&lt;br /&gt;
&lt;br /&gt;
=== print_time_selector (0) ===&lt;br /&gt;
&lt;br /&gt;
=== print_user_picture (0) ===&lt;br /&gt;
&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
print_user_picture($user, $courseid, $picture, $size, $return, $link, $target, $alttext);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code (simple):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$userpic = new moodle_user_picture();&lt;br /&gt;
$userpic-&amp;gt;user = $user;&lt;br /&gt;
$userpic-&amp;gt;courseid = $courseid;&lt;br /&gt;
echo $OUTPUT-&amp;gt;user_picture($userpic);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code (complex: alternate text, size, different image and popup action):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$userpic = new user_picture();&lt;br /&gt;
$userpic-&amp;gt;user = $user;&lt;br /&gt;
$userpic-&amp;gt;courseid = $courseid;&lt;br /&gt;
$userpic-&amp;gt;size = $size;&lt;br /&gt;
$userpic-&amp;gt;link = $link;&lt;br /&gt;
$userpic-&amp;gt;visibletoscreenreaders = false;&lt;br /&gt;
$userpic-&amp;gt;alttext = $alttext;&lt;br /&gt;
$userpic-&amp;gt;image-&amp;gt;src = $picture;&lt;br /&gt;
$userpic-&amp;gt;add_action(new popup_action(&#039;click&#039;, new moodle_url($target)));&lt;br /&gt;
&lt;br /&gt;
echo $OUTPUT-&amp;gt;user_picture($userpic);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== update_course_button (0) ===&lt;br /&gt;
&lt;br /&gt;
=== update_module_button (94) ===&lt;br /&gt;
Old code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$button = update_module_button($cm-&amp;gt;id, $course-&amp;gt;id, get_string(&#039;modulename&#039;, &#039;workshop&#039;)); // passed to print_header_simple()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
New code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;set_button($OUTPUT-&amp;gt;update_module_button($cm-&amp;gt;id, &#039;workshop&#039;));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note: $courseid param has been dropped.&lt;br /&gt;
&lt;br /&gt;
=== update_tag_button (0) ===&lt;br /&gt;
&lt;br /&gt;
== Non-supported functions ==&lt;br /&gt;
These functions have been completely dropped in 2.0, most likely because they were used very little or not at all. All calls to these functions in core should have been replaced.&lt;br /&gt;
=== blocks_print_group ===&lt;br /&gt;
=== print_file_picture ===&lt;br /&gt;
=== print_png ===&lt;br /&gt;
=== print_scale_menu ===&lt;br /&gt;
=== print_side_block_end ===&lt;br /&gt;
=== print_side_block_start ===&lt;br /&gt;
=== print_timer_selector ===&lt;br /&gt;
=== print_user ===&lt;br /&gt;
=== update_categories_search_button ===&lt;br /&gt;
=== update_mymoodle_icon ===&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[How Moodle outputs HTML]]&lt;br /&gt;
* [[Migrating your code to the 2.0 rendering API]]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=46339</id>
		<title>Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=46339"/>
		<updated>2014-10-02T07:35:13Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Navigation overhaul&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = https://tracker.moodle.org/browse/MDL-45774&lt;br /&gt;
|discussion = https://moodle.org/mod/forum/discuss.php?d=261224&lt;br /&gt;
|assignee = Frédéric Massart, Jetha Chan&lt;br /&gt;
}}&lt;br /&gt;
{{Work in progress|forumurl=https://moodle.org/mod/forum/discuss.php?d=261224}}&lt;br /&gt;
Navigation throughout Moodle is often confusing and needs some improvement. With this in mind, a specification has been prepared, defining what problems were identified and how they will be solved. Particular focus will be placed upon improving the experience of students, teachers, and users unfamiliar to Moodle.&lt;br /&gt;
&lt;br /&gt;
== What can be improved ==&lt;br /&gt;
&lt;br /&gt;
Common complaints leveled at Moodle include:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unnecessary steep learning curve&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Features or options not being discovered&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;General frustration&#039;&#039;&#039; - clunkiness, a certain &#039;&#039;je ne sais quoi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The navigation is not static ===&lt;br /&gt;
&lt;br /&gt;
Sometimes when navigating from one place to another, the state of the tree in the navigation block completely changes. A good example of this is when going from a course to a module - upon arrival in a module, the Administration block will display a collapsed &#039;Course administration&#039; node and a new expanded &#039;Module administration&#039; node, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
[[File:pbnotstatic.png|frame|none|alt=Going from course to a module.|Going from course to a module.]]&lt;br /&gt;
&lt;br /&gt;
Consistency should be improved here, as it is unlikely that a user unfamiliar with the system will understand sudden collapsing of or additional nodes.&lt;br /&gt;
&lt;br /&gt;
=== Feature placement ===&lt;br /&gt;
&lt;br /&gt;
It is our opinion that some navigation nodes contain things that you wouldn&#039;t expect, and don&#039;t contain things that you &#039;&#039;&#039;would&#039;&#039; expect. For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;My profile settings&#039; contains &#039;Blogs&#039;, &#039;Badges&#039; or &#039;Messaging&#039;. These are not strictly related to your profile, they are related to your user account.&lt;br /&gt;
* What can be found under &#039;Site pages&#039;?&lt;br /&gt;
* Notes&lt;br /&gt;
** In order to view Notes taken on a course level, I first need to click on &#039;Participants&#039;, and once the page is loaded I can see new entries in the navigation node &#039;Participants&#039;. Why is this the case? Most users will not be aware of those links and will miss out on that feature, we feel.&lt;br /&gt;
&lt;br /&gt;
=== Bad naming ===&lt;br /&gt;
&lt;br /&gt;
Proper naming of the navigation helps the user remembering where to find what they are looking for. It also helps them to discover features that they would not otherwise be aware of, e.g. &#039;Calendar&#039;, hidden under &#039;Site pages&#039;. If a user has no understanding of what &#039;Site pages&#039; is, it is unlikely that they will expand it.&lt;br /&gt;
&lt;br /&gt;
Another popular(?) example of bad naming is the link &#039;My grades&#039; under &#039;Course administration&#039; in the &#039;Administration&#039; block. &#039;A student is not administrating anything, his grades are not a setting.&#039;&lt;br /&gt;
&lt;br /&gt;
=== Context jumps ===&lt;br /&gt;
&lt;br /&gt;
The breadcrumb and navigation sometimes jump from one context to another. For instance, as a student when you click on &#039;Administration &amp;gt; Course administration &amp;gt; My grades&#039;, the navigation node on which you appear to be after clicking is &#039;Administration &amp;gt; Grade administration &amp;gt; User report&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps.png|frame|none|alt=Breadcrumb context jumping.|Breadcrumb context jumping.]]&lt;br /&gt;
&lt;br /&gt;
It is also possible for the user to jump from a course context to a site context, leaving the course (different breadcrumb, different navigation) without realising it and instantly feeling lost. A common reaction would be to use the &#039;Back&#039; button of their browser to recover from it rather than trying to understand what happened. This behaviour can be observed when visiting someone&#039;s profile, viewing some reports, etc...&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps2.png|frame|none|alt=Navigation context jumping.|Navigation context jumping.]]&lt;br /&gt;
&lt;br /&gt;
In order for users to feel comfortable and confident, and to not feel lost in Moodle&#039;s complex page hierarchy, we need to prevent situations where they feel lost and frustrated.&lt;br /&gt;
&lt;br /&gt;
=== Overwhelming the user ===&lt;br /&gt;
&lt;br /&gt;
Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;.  We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&lt;br /&gt;
&lt;br /&gt;
== The goal ==&lt;br /&gt;
&lt;br /&gt;
We seek to provide navigation that is:&lt;br /&gt;
&lt;br /&gt;
* Simpler&lt;br /&gt;
* Intuitive&lt;br /&gt;
* Easy to learn&lt;br /&gt;
&lt;br /&gt;
Leading to myriad benefits, including but not limited to:&lt;br /&gt;
&lt;br /&gt;
; Efficiency&lt;br /&gt;
: Less trial and error when looking for something&lt;br /&gt;
; Common expectations being met&lt;br /&gt;
: Pages being found where you expect them to be&lt;br /&gt;
; A reduction in confusion and general frustration&lt;br /&gt;
; Less resistance&lt;br /&gt;
: New users feeling more confident using the product&lt;br /&gt;
&lt;br /&gt;
Some risk does present itself; by changing large sections of the product, we risk alienating existing experienced Moodle users, frustrated at not finding pages where they used to be. On the other hand, re-learning the navigation should be straightforward, painless and at the very least easier than learning it the first time. User documentation will also suffer in the interim, as screenshots, navigation patterns and other training materials will have to be updated.&lt;br /&gt;
&lt;br /&gt;
== Rough ideas ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of ideas gathered from discussions and resources both internal and external to HQ:&lt;br /&gt;
&lt;br /&gt;
* A student should be able to quickly access his courses, grades, settings, profile from a static place in the UI. This would remove the need for them to expand nodes in both the &#039;Navigation&#039; block and the &#039;Administration&#039; block.&lt;br /&gt;
* The different nodes of the &#039;Administration&#039; block could be displayed on a &#039;Preferences&#039; page.&lt;br /&gt;
** e.g. the &#039;Course administration&#039; items could be listed on a page, each node being a title and each of its elements listed underneath. By moving administration settings to a single page, we obviate the need for the &#039;Administration&#039; block entirely.&lt;br /&gt;
* A teacher should be able to quickly access the &#039;Options&#039; of a course through a static node, the same way a user can access anything associated to his account.&lt;br /&gt;
* Similarly for modules, an easy dropdown to access module preferences and more frequently used options could be created.&lt;br /&gt;
* Breadcrumb-based navigation to reduce and perhaps entirely remove the the need for the nested and cumbersome Navigation block.&lt;br /&gt;
** This could be problematic in regards to creating problems with accessing site pages, or pages which do not clearly have a hierarchical position.  This could be addressed by providing &#039;in context&#039; links. For instance, adding a new block entry should be available from the Blog page.&lt;br /&gt;
* Providing a sitemap page to counter the lack of &#039;Navigation&#039; block when something is not easily accessible.&lt;br /&gt;
* Ability to &#039;Star&#039; some pages to quickly access favourites.&lt;br /&gt;
* Develop a &#039;Smart search&#039; to easily access the content in the current course, other courses, etc… and the admin settings for admins.&lt;br /&gt;
* Populating my/ page with more useful content for the user itself.&lt;br /&gt;
* A new profile page on which is displayed the &#039;public&#039; information of the user. Their forum interactions, their blog, their reports, ...&lt;br /&gt;
* Providing an API to modules to implement their own navigation, thus not required to inject links in the navigation block like &#039;Chat&#039; is doing or &#039;Quiz&#039; used to do (Results report). This navigation would be displayed in a standard fashion across modules. (Tabs like in wiki?)&lt;br /&gt;
* When hovering a user&#039;s name, a menu could appear with a few details and links to their profile, etc... (like Jira does).&lt;br /&gt;
&lt;br /&gt;
== Analysis of popular themes ==&lt;br /&gt;
&lt;br /&gt;
Although most of those themes do not change anything about the navigation itself, a few have implemented a &#039;&#039;user menu&#039;&#039;. Usually displayed at the top most right of the screen, it contains links to quickly access user specific pages. The most common links are:&lt;br /&gt;
&lt;br /&gt;
* View profile&lt;br /&gt;
* Edit profile&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
Less popular links are:&lt;br /&gt;
&lt;br /&gt;
* Calendar&lt;br /&gt;
* My private files&lt;br /&gt;
* My home&lt;br /&gt;
&lt;br /&gt;
== The solutions ==&lt;br /&gt;
&lt;br /&gt;
To achieve our goal we have to remove the need for the administration and navigation blocks. This is a long process that needs to be broken down into sub-solutions. Some will need to be developed simultaneously to avoid half-baked temporary solutions. Those solutions can be split into two categories: &#039;User&#039;, and &#039;Course&#039;.&lt;br /&gt;
&lt;br /&gt;
User solutions:&lt;br /&gt;
&lt;br /&gt;
* A user menu&lt;br /&gt;
* A user preferences page&lt;br /&gt;
* A new profile page&lt;br /&gt;
* Revisiting &#039;My home&#039; page&lt;br /&gt;
&lt;br /&gt;
Course solutions:&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* A course &#039;Quick access&#039; menu&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
&lt;br /&gt;
The user menu is a dropdown containing links to pages specific to user. They are context independent and will always point to the same pages. The user menu can always be found at the same place in the user interface and will contain the following links:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* My grades&lt;br /&gt;
* Messages&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
[[File:usermenu.png|frame|none|alt=A user menu.|A user menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Gives quick and intuitive access to the user specific pages&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Emphasises the page &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== User preferences page ===&lt;br /&gt;
&lt;br /&gt;
A link to that page would be placed in the user menu. That page will contain most of what the user has control over on a site level. Their mailing preferences, changing their password, etc... but reorganised.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* We can remove &#039;My profile settings&#039; from the &#039;Administration&#039; block.&lt;br /&gt;
* The settings are all reachable from one place.&lt;br /&gt;
* New pages will help the user understanding what settings they have control over.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
By adding new content to the profile page, we can trim a bit more the navigation block. The profile page is supposed to contain anything you could find about a user, and there will be links to their blog, forum interactions, notes, to send them a message, etc...&lt;br /&gt;
&lt;br /&gt;
We will keep the distinction between the full profile and the course profiles, at this stage we only improve the site profile because the course profiles need more thoughts and are tied to the course solutions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Answering concerns of the &#039;User preferences page&#039;&lt;br /&gt;
* Bonus: the profile page has a reason to be visited&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
The My/ page is underused and does not contain enough valuable information for the users to visit it. We will update it to include more user-specific content. It will contain:&lt;br /&gt;
&lt;br /&gt;
* My courses&lt;br /&gt;
* My private files&lt;br /&gt;
* The calendar and upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
[[File:myhome.png|frame|none|alt=The new dashboard.|The new dashboard.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;, at this point it should be empty&lt;br /&gt;
* Making the my/ page more interesting and valuable&lt;br /&gt;
&lt;br /&gt;
=== Handling of course profiles ===&lt;br /&gt;
&lt;br /&gt;
We need to remove the confusion between site and course profiles, only a few more informations should be available when viewing a &#039;Course profile&#039;, but we do not need an entirely different profile for that purpose. The course specific information will be accessible from the user profile, but be in the context of the site profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No more course profile pages&lt;br /&gt;
&lt;br /&gt;
=== A course &#039;Quick access&#039; menu ===&lt;br /&gt;
&lt;br /&gt;
In order to remove the need for the nodes &#039;Participants&#039; and &#039;Badges&#039; from the &#039;Course&#039; entry in the &#039;Navigation block&#039;, and the &#039;Grades&#039; entry in the &#039;Course administration&#039; node (for students), we will implement a new &#039;Quick access&#039; menu for the course. This menu will be accessible on any page within a course, or module.&lt;br /&gt;
&lt;br /&gt;
This menu will only contain links to the 3 entries mentioned above. If later on we add more links to that list, the additional (and less important) entries will be displayed in a dropdown, or a in a &#039;More&#039; page.&lt;br /&gt;
&lt;br /&gt;
A new grades page will be created for students to access their course grades.&lt;br /&gt;
&lt;br /&gt;
It is important to keep the visible elements of this menu to a minimum. Not more than 3 elements should be displayed at a time. An exception can be made for users with more privileges who will see a &#039;Settings&#039; (or &#039;Administration&#039;) link, and perhaps a &#039;Reports&#039; one when we will work on them (see the following the other solutions below).&lt;br /&gt;
&lt;br /&gt;
To unenrol yourself from a course, you would not look into the &#039;Course administration&#039; node, you would rather find a link on &#039;My home&#039; page next to the list of courses to unenrol yourself from them.&lt;br /&gt;
&lt;br /&gt;
[[File:coursemenu.png|frame|none|alt=An example of a course quick-access menu.|An example of a course quick-access menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming the navigation block&lt;br /&gt;
* Removing the &#039;Course administration&#039; node for students&lt;br /&gt;
* Dedicated grades page for the students&lt;br /&gt;
* Quick access to the most important pages of a course&lt;br /&gt;
&lt;br /&gt;
=== An administration page per module ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the module would list everything that was originally in the &#039;Module administration&#039; node, but reorganised to be more intuitive. A link to that page would be placed somewhere in the general UI.&lt;br /&gt;
&lt;br /&gt;
Modules currently using the &#039;Adminstration&#039; block to inject new pages into their module should be updated to provide a module navigation instead. It could be a list of links in the module page, or a module navigation such as tabs, this is probably tied to the solution &#039;Alternative site and course navigation&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the module administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* Removes the need for the &#039;Module administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
&lt;br /&gt;
=== An administration page for the course ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the course would list everything that was originally in the &#039;Course administration&#039; node, but reorganised to be more intuitive. A link to that page will be added to the course &#039;Quick access&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the course administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* No more &#039;Course administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
* Reports would be accessible from that page until &#039;Dedicated solution to access reports&#039; is implemented&lt;br /&gt;
&lt;br /&gt;
=== Dedicated solution to access reports ===&lt;br /&gt;
&lt;br /&gt;
Reports are the black sheep of the navigation, nobody agrees on where they should be and they are moved around every so often. Perhaps nobody agrees because they do not belong either in the navigation or the administration block.&lt;br /&gt;
&lt;br /&gt;
Currently they are accessed from the &#039;Administration&#039; block, and as we are moving the content of the block to administration pages, that is where they will end up. This is surely not better (perhaps even worse) than where they were before, so why not thinking once and for all where they should be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/!\ Solution needed!&lt;br /&gt;
&lt;br /&gt;
Idea: We could add a &#039;Report&#039; menu to the course &#039;Quick access&#039; menu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Standardised way to access reports&lt;br /&gt;
* A navigation that does not jump somewhere else when viewing a report&lt;br /&gt;
&lt;br /&gt;
=== Alternative site and course navigation ===&lt;br /&gt;
&lt;br /&gt;
Now that everything has been sorted out, we should now be able to remove the navigation block - but first we&#039;ll need to sort out how to navigate at both the site and course levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Site level&#039;&#039;&#039;&lt;br /&gt;
It is envisaged that the frontpage would just be an entry point, with the navigation node &#039;Site pages&#039; displayed in a block specific to those site pages. Upon leaving the context of the &#039;Site&#039;, you will be in a course; most users will not go back to the front page, except to find some information specific to their institution. To navigate between their courses, teachers and students could refer to their my/ page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, pages like &#039;Participants&#039;, &#039;Badges&#039; or &#039;Tags&#039; could be accessed from their context, for instance in a &#039;Online users&#039; block which would link to &#039;All participants&#039;. The same applies for &#039;Calendar&#039;, but is already the case because of its block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course level&#039;&#039;&#039;&lt;br /&gt;
The site-level concept should disappear as soon as you get in a course; the student or teacher would then focus 100% on the course they are browsing rather than being distracted by site elements. This behavior is currently exhibited by the base and standard themes in 2.6 and before.&lt;br /&gt;
&lt;br /&gt;
The course format will become responsible for most of the navigation in the course, allowing course formats to:&lt;br /&gt;
&lt;br /&gt;
* Inject block(s) to navigate between sections&lt;br /&gt;
* Inject block(s) to navigate between modules&lt;br /&gt;
* Inject block(s) that does/do both of the above (very similar to the course node in the navigation block)&lt;br /&gt;
* Inject links &#039;Go to next activity&#039;, &#039;Go back to course&#039;, ... into module views.&lt;br /&gt;
&lt;br /&gt;
The course format will also have control over the course &#039;Quick access&#039; menu, in which it could inject/remove items if they wanted to.&lt;br /&gt;
&lt;br /&gt;
The node &#039;Switch role&#039; will be removed from the administration block, necessitating a &#039;Switch role&#039; block to be added to the course to unlock that functionality. This block would only be displayed to users having the capabilities to switch role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Future of the Administration block&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, the administration block will not be displayed to any user, except those users possessing elevated privileges. Administrators, managers or course creators will still have access to the administration block but it will only contain the &#039;Site administration&#039; node.&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
All the pages in a user context will have their own layout wherein the header includes the name of the user in a standardised way, along with some information and a link to message them, and their preferences if the logged in user has the capabilities to edit them. A renderer will be responsible for creating the header, and will use the user ID found from the context defined on that page.&lt;br /&gt;
&lt;br /&gt;
The navigation within the context pages will be:&lt;br /&gt;
&lt;br /&gt;
; For your own context&lt;br /&gt;
: Home &amp;gt; Your Name &amp;gt; Page you are on. Clicking on &#039;Your Name&#039; will lead you to &#039;My home&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader.png|frame|none|alt=The header when viewing your context.|The header when your context.]]&lt;br /&gt;
&lt;br /&gt;
; For other users&#039; context&lt;br /&gt;
: Home &amp;gt; Users &amp;gt; User Name &amp;gt; Page you are on. Clicking on &#039;User Name&#039; will lead you to their profile.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader2.png|frame|none|alt=The header when viewing someone else&#039;s context.|The header when viewing someone else&#039;s context.]]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The user header contains very simplistic information about the user, and a few links to very common actions in regard to other users. For instance it can implement a link to send a message to the user, because you might want to be able to do that regardless of what user context page you are visiting. But, &#039;Edit profile&#039; should not be in it, because it is only relevant to the profile. It is very important to keep the number of available actions to a minimum, because having too many options would defeat the purpose of the simplicity and efficiency it is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== A user menu ===&lt;br /&gt;
&lt;br /&gt;
The new user menu would be a new renderer, called from the layout files as it was the case for the login info renderer. The content of the user menu is fixed and not configurable, however it is possible to override the renderer from a theme to change its layout and content.&lt;br /&gt;
&lt;br /&gt;
==== Design ====&lt;br /&gt;
&lt;br /&gt;
Placed on the top right of the site, the name of the user is displayed next to a user icon. The dropdown is displayed when the user clicks the icon or the name. On smaller screens only a user icon is displayed, and expands to reveal its content. When expanded the name of the user logged in is displayed.&lt;br /&gt;
&lt;br /&gt;
When the user is not logged in or when the user is logged in as a guest, a login link is displayed, regardless of the screen size.&lt;br /&gt;
&lt;br /&gt;
==== My grades ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My grades&#039; page will display the overall grades of the student in all their visible courses. The ordering can be changed, but the default would be alphabetical.&lt;br /&gt;
&lt;br /&gt;
==== Login as ====&lt;br /&gt;
&lt;br /&gt;
When logged in as someone else, the &#039;Logout&#039; entry becomes &#039;Return to Admin User&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Switch role ====&lt;br /&gt;
&lt;br /&gt;
When the user role is switched, the &#039;Logout&#039; entry becomes &#039;Return to my normal role&#039;. And the name of the user is appended with the role they switch to, e.g. &#039;Admin User (teacher)&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Trimming navigation ====&lt;br /&gt;
&lt;br /&gt;
At this stage we could trim the navigation block, but we decide not to remove anything just yet as it would create more confusion: some nodes would accessible from the user menu, and others from the navigation block.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
For it to be used, the user menu needs to be as short as possible and not being cluttered with additional links. It should contain what has been decided upon above, and not be changed - as users will acclimatise to it, adding and removing nodes should not be looked upon lightly. In any case, it should not contain more than 6 links, and should always contain:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* Preferences&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
These are very important to the user as they target user context-specific pages and nothing related to the site structure or the course. A link to &#039;My courses&#039; would be redundant as this information should be covered in the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
=== A user preferences page ===&lt;br /&gt;
&lt;br /&gt;
The preferences page is a list of links to sub-preferences page. The page will be generated from the navigation node &#039;My profile settings&#039;, though we will have to re-organise them so that each link belongs to a parent node. A link to the preferences page is added to the user menu.&lt;br /&gt;
&lt;br /&gt;
==== Re-organisation ====&lt;br /&gt;
&lt;br /&gt;
* User account&lt;br /&gt;
** Edit profile&lt;br /&gt;
** Account settings&lt;br /&gt;
** Change password&lt;br /&gt;
** Security keys&lt;br /&gt;
** Messaging&lt;br /&gt;
&lt;br /&gt;
* Blogs&lt;br /&gt;
** Preferences&lt;br /&gt;
** External blogs&lt;br /&gt;
** Register an external blog&lt;br /&gt;
&lt;br /&gt;
* Badges&lt;br /&gt;
** Manage my badges&lt;br /&gt;
** Preferences&lt;br /&gt;
** Backpack settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preferences page displays headings (the setting nodes) under which the links to the sub-pages will be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
The nodes &#039;Roles&#039; and &#039;Activity reports&#039; will not be part of this page, because they are context based: they point to the course or site context depending on the page we are on. They will remain in the navigation block, but only when the user has the capability to view them. When the only node in the &#039;My profile settings&#039; node is &#039;Preferences&#039;, then &#039;My profile settings&#039; is not displayed. Here is an example when you have the capability to view the reports and roles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblockpref.png|frame|none|alt=My profile settings node with extended capability.|My profile settings node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My profile settings&#039; node becomes the name of the user: &#039;Frédéric Massart&#039;. The &#039;Profile settings for Jetha Chan&#039; becomes &#039;Jetha Chan&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breadcrumb ====&lt;br /&gt;
&lt;br /&gt;
Each of the sub-pages should be checked to ensure that they are in the right hierarchy, the breadcrumb always looks like &#039;(User context nav) &amp;gt; Preferences &amp;gt; Preference heading &amp;gt; Page I am on&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Another user&#039;s preferences ====&lt;br /&gt;
&lt;br /&gt;
The node &#039;Profile settings for User B&#039; can be used to edit someone&#039;s settings. The content is similar to &#039;My profile settings&#039;, except that the node will always be displayed regardless of the presence of &#039;Roles&#039; or &#039;Activity reports&#039;. Currently there is no other way for a user with elevated privileges to access someone&#039;s preferences, but sooner or later the preferences will be accessible from their profiles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblocksomeonelse.png|frame|none|alt=Profile settings for X with extended capability.|Profile settings for X node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Repositories ====&lt;br /&gt;
&lt;br /&gt;
At present, repositories are configurable from the Navigation block - this is a good opportunity to move them to the &#039;Preferences&#039; page.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
Every link in this page should belong to a section, the sections are only headers that help the users finding what they are looking for. A plugin that adds user preferences related to its features should define a new heading and add its links to that heading. The heading is never clickable.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
For now we will only be focussing on the site profile of the user. Later on, we will be solving the problems linked to the course context, for instances the links to &#039;Blog&#039; or &#039;Forum interactions&#039; automatically filtered to only display the blog posts in the course.&lt;br /&gt;
&lt;br /&gt;
==== Content ====&lt;br /&gt;
&lt;br /&gt;
The contact details will be displayed in such a way that they do not look like a list any more. For instance, everyone knows what an email address is, there is no need to prefix it with &#039;Email address:&#039;.&lt;br /&gt;
&lt;br /&gt;
The badges will be displayed on the profile too.&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&lt;br /&gt;
* Edit profile (If this is your profile)&lt;br /&gt;
* Blog&lt;br /&gt;
* Forum interactions&lt;br /&gt;
* Notes (If you have the capability to)&lt;br /&gt;
* Preferences (If you have the capability to and are viewing someone&#039;s profile)&lt;br /&gt;
* Send a message&lt;br /&gt;
* Login as (If you have the capability to)&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can start trimming the node &#039;My profile&#039; a bit, but some nodes will remain until we sort out the &#039;My&#039; page. When doing so, it is important to make sure that the nodes &#039;Home &amp;gt; Some course &amp;gt; Participants &amp;gt; User B&#039; still contain everything it does right now, because those links point to course-based pages, and would not be accessible otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The profile page contains everything about the user that is public. In other words, a content specific to the user should not be displayed on the profile at all, because it would never be accessible to another user, e.g. &#039;Private files&#039;.&lt;br /&gt;
&lt;br /&gt;
There are exceptions to this rule, badges for example. As a setting allows you to define whether or not your badges are on your profile, you might not be able to see them there, so they should be available on your dashboard.&lt;br /&gt;
&lt;br /&gt;
For content controlled by permissions (and not preferences), they should remain on the profile. Take &#039;Blog&#039; as an example, an administrator can prevent blog entries from another user to be accessed depending on your role. As the user does not have any information about the roles of the other users, the blog link is displayed on the profile, but other users will not see it. Having a blog block on the &#039;My home&#039; page would not be useful because it simply duplicates the access points, for no apparent reason to the user.&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
We need to add more default blocks to the existing page, the different available blocks will be:&lt;br /&gt;
&lt;br /&gt;
* My courses (already there)&lt;br /&gt;
* My private files (already there)&lt;br /&gt;
* The calendar&lt;br /&gt;
* Upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
We need to add a link to &#039;My latest badges&#039; to the page listing all the badges.&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can now remove &#039;My profile&#039; (or now called &#039;Jetha Chan&#039;) from the navigation block entirely. But it has to still be accessible under the node of a user in a course tree.&lt;br /&gt;
&lt;br /&gt;
The node &#039;My courses&#039; is also removed, users should be used to using their dashboard to access their courses.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My home&#039; page contains everything about a user that is private and not accessible to other users. For instance, your calendar events or your private files. The list of courses you are enrolled in are an exception, they could be displayed on the user profile, but because they are so important and need to be layed out in useful fashion, they will be part of the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
This page does not need to link to pages which are already accessible from the &#039;User menu&#039;, for instance the profile.&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pending&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Accessing course grades for students&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
** Checking for inconsistencies in the breadcrumb jumping from one place to another.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
# The user menu&lt;br /&gt;
# Implementing the user &#039;header&#039; for user context pages&lt;br /&gt;
# The preferences page&lt;br /&gt;
# The new profile page&lt;br /&gt;
# Revisiting &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;To be defined.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.google.com/document/d/16BJsINun13StUFOQaejj3Gawz9jk22ir_r49f3MbInM/edit#heading=h.fuvsbkikzj88 Navigation experiment]&lt;br /&gt;
* [https://docs.google.com/document/d/1AXJw8uX6MczA5VC3phkVVv1ee5eZ2nluIiPC2ecgHLE/edit#heading=h.k3lh9alzq3iy Navigation prototyping 2.7]&lt;br /&gt;
* MDL-34838: Navigation inconsistencies&lt;br /&gt;
* [http://demo2k12.moodlerooms.com Minimal by Moodlerooms]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226791 Users’ personalised profiles]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Peer_reviewing&amp;diff=46323</id>
		<title>Peer reviewing</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Peer_reviewing&amp;diff=46323"/>
		<updated>2014-09-30T09:22:04Z</updated>

		<summary type="html">&lt;p&gt;Jethac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are points to consider while peer-reviewing issues. Further explanation below.&lt;br /&gt;
&lt;br /&gt;
 [] Syntax&lt;br /&gt;
 [] Whitespace&lt;br /&gt;
 [] Output&lt;br /&gt;
 [] Language&lt;br /&gt;
 [] Databases&lt;br /&gt;
 [] Testing (instructions and automated tests)&lt;br /&gt;
 [] Security&lt;br /&gt;
 [] Documentation&lt;br /&gt;
 [] Git&lt;br /&gt;
 [] Third party code&lt;br /&gt;
 [] Sanity check&lt;br /&gt;
 [] Icons&lt;br /&gt;
&lt;br /&gt;
Acceptable check-marks are Y (for yes), N (for no) or - (for not applicable). All N check-marks should be accompanied by an explanation of the problem that still needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
To allow the community of Moodle developers to work together, conventions should be followed.&lt;br /&gt;
&lt;br /&gt;
* The code is easy to understand and, where it isn&#039;t, comments have been provided.&lt;br /&gt;
* Variables are named correctly (all lower case, no camel-case, no underscores).&lt;br /&gt;
* Functions are named correctly (all lower case, no camel-case, underscores allowed).&lt;br /&gt;
* PHP DocBlocks have been updated and adhere to [[Coding_style#Documentation_and_comments|coding style guide]].&lt;br /&gt;
* Where functions are being removed, the [[Deprecation]] process is followed.&lt;br /&gt;
* The code doesn&#039;t use [[Deprecated_functions_in_2.0|deprecated functions]].&lt;br /&gt;
* $_GET, $_POST, $_REQUEST, $_COOKIE, and $_SESSION are never used.&lt;br /&gt;
&lt;br /&gt;
See the [[Coding style]] guide for details.&lt;br /&gt;
&lt;br /&gt;
==Whitespace==&lt;br /&gt;
Unnecessary whitespace changes can cause conflicts when committing code.&lt;br /&gt;
&lt;br /&gt;
Ensure that:&lt;br /&gt;
* there are no unnecessary blank lines in the new code;&lt;br /&gt;
* blank lines do not contain spaces;&lt;br /&gt;
* there are no unnecessary changes to whitespace in other areas on the file;&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
Output needs to be controlled by renderers to achieve consistency and correct application of themes.&lt;br /&gt;
&lt;br /&gt;
Ensure that:&lt;br /&gt;
* output renders are used to generate output strings, including HTML tags;&lt;br /&gt;
* HTML output is valid XHTML;&lt;br /&gt;
* no inline styles have been used in HTML output (everything has to be in CSS);&lt;br /&gt;
* CSS has been added to the appropriate CSS files (base, specific area, sometimes canvas); and&lt;br /&gt;
* the code doesn&#039;t use buffered output unless absolutely necessary.&lt;br /&gt;
* all visual output has a RTL alternative included&lt;br /&gt;
&lt;br /&gt;
feedback any notices (E_STRICT, etc) seen into the MDL.&lt;br /&gt;
&lt;br /&gt;
==Language==&lt;br /&gt;
To achieve appropriate internationalisation of Moodle, language strings must be managed correctly.&lt;br /&gt;
&lt;br /&gt;
Ensure that:&lt;br /&gt;
* new language strings are named correctly (all lower case, no camel-case, underscores are permissible in some cases);&lt;br /&gt;
* help strings are named and formatted as described in [[Help strings]];&lt;br /&gt;
* language strings are used instead of hard-coded strings for text output;&lt;br /&gt;
* language strings have not been removed or renamed, had their meaning changed or had their parameters changed in stable branches (permitted only in master); and&lt;br /&gt;
* AMOS commands have been specified when moving or copying language strings.&lt;br /&gt;
&lt;br /&gt;
==Databases==&lt;br /&gt;
DB calls are the greatest performance bottleneck in Moodle.&lt;br /&gt;
&lt;br /&gt;
If there is SQL code you can test quickly then do so. &lt;br /&gt;
&lt;br /&gt;
Ensure that:&lt;br /&gt;
* there are minimal DB calls (no excessive use of the DB); and&lt;br /&gt;
* the code uses SQL compatible with all the supported DB engines (check all selected fields appear in an &#039;order by&#039; clause).&lt;br /&gt;
&lt;br /&gt;
==Testing instructions and automated tests==&lt;br /&gt;
It is the developer&#039;s responsibility to test code before integration. Issues should not be sent for peer review without tests so that the peer reviewer can assess their quality and use them to consider the scope of the issue.&lt;br /&gt;
&lt;br /&gt;
Ensure that:&lt;br /&gt;
* there are specific testing instructions that state how, as well as what, to test. Please ensure that the testing instructions are in the correct format: [https://docs.moodle.org/dev/Behat Behat gherkin];&lt;br /&gt;
* new unit tests have been added when there is a change in functionality; and&lt;br /&gt;
* &#039;&#039;&#039;unit tests pass&#039;&#039;&#039; for related areas where changes have been made.&lt;br /&gt;
* &#039;&#039;&#039;Behat tests pass&#039;&#039;&#039; for related areas where changes have been made, especially when it involved UI changes.&lt;br /&gt;
&lt;br /&gt;
==Security==&lt;br /&gt;
The user community relies on Moodle being responsibly secure.&lt;br /&gt;
&lt;br /&gt;
Ensure that:&lt;br /&gt;
* user login is checked where an identity is needed;&lt;br /&gt;
* sesskey values are checked before all write actions where appropriate (some read actions as well);&lt;br /&gt;
* capabilities are checked where roles differ; and&lt;br /&gt;
* if the issue itself is a [[Security|security]] issue, the [[Process#Security_issues|security process]] is being followed.&lt;br /&gt;
** Ensure that the fix is &#039;&#039;&#039;not&#039;&#039;&#039; available in a public repository (ie. a personal Github account); stand-alone patches should be provided instead.&lt;br /&gt;
** The issue will not be integrated until just before the next minor version release.&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
Work does not stop when code is integrated.&lt;br /&gt;
&lt;br /&gt;
Ensure that:&lt;br /&gt;
* Appropriate [[Tracker_issue_labels|labels]] have been added when there has been a function change, particularly&lt;br /&gt;
** qa_test_required (significant functional change),&lt;br /&gt;
** docs_required (any functional change, usually paired with ui_change),&lt;br /&gt;
** dev_docs_required (any change to APIs, usually paired with api_chage),&lt;br /&gt;
** ui_change (any functional change, usually paired with docs_required, except ui_change remains permanetly), and&lt;br /&gt;
** api_change (any change to APIs that devs will need to know about, usually paired with dev_docs_required, except api_change remains permanetly).&lt;br /&gt;
&lt;br /&gt;
==Git==&lt;br /&gt;
Ensure that:&lt;br /&gt;
* the commit matches the [[Coding style#Git_commits|Coding style]]&lt;br /&gt;
* the Git history is clean and the work has been rebased to logical commits; and&lt;br /&gt;
* the original author of the work provided as a patch has been given credit within the commit (as author of in the commit message if changes were made).&lt;br /&gt;
&lt;br /&gt;
==Third party code==&lt;br /&gt;
Does the change contain third party code? If so, ensure that:&lt;br /&gt;
&lt;br /&gt;
* The code is licensed under a [http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses| GPL compatible license].&lt;br /&gt;
* The instructions for upgrading/importing the library and contained within a readme_moodle.txt file.&lt;br /&gt;
* The library is recorded in a thirdparty.xml file, including licensing information.&lt;br /&gt;
* Third party code has been scanned to check for url accessible entry points that could be exploited. These should either be disabled, or if required functionality they should be checked for security weaknesses.&lt;br /&gt;
* Does not duplicate the functionality of any existing api or third party library in core.&lt;br /&gt;
&lt;br /&gt;
==Sanity check==&lt;br /&gt;
Ensure that:&lt;br /&gt;
* the code seems to solve the described problem completely within its reported scope (and further issues have been created to resolve remaining parts or further refactoring);&lt;br /&gt;
* the code makes sense in relation to the broader codebase (look at the whole function, not just the altered code); and&lt;br /&gt;
* the developer has searched for and fixed other areas that may also have been affected by the same problem.&lt;br /&gt;
* if any version numbers have been changed in [[version.php]] files, then the changes follow [[Moodle_versions#How_to_increment_version_numbers_in_core|the rule for updating version numbers in core]].&lt;br /&gt;
&lt;br /&gt;
==Icons==&lt;br /&gt;
Are new icons being introduced? If so, ensure that:&lt;br /&gt;
* the icons abide by our [https://docs.moodle.org/dev/Moodle_icons icon guidelines] with regards to size, design and format&lt;br /&gt;
* the icons are do not unnecessarily add new ways of expressing existing concepts&lt;br /&gt;
* the icons are in a pix folder that makes sense&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [http://moodle.org/plugins/view.php?plugin=local_codechecker Code checker plugin]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Navigation_overhaul_specification&amp;diff=45146</id>
		<title>Talk:Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Navigation_overhaul_specification&amp;diff=45146"/>
		<updated>2014-06-05T09:04:32Z</updated>

		<summary type="html">&lt;p&gt;Jethac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;. We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
IMHO Scroll of death is more having so much content in a linear layout that it&#039;s impossible to navigate, rather than there being too many nodes in either of the blocks. However both influence each other:&lt;br /&gt;
Lots of content in a straight list introduces navigation issues, however if the navigation only presents straight lists then likely to get content that simply reinforces it --[[User:Michael Hughes|Michael Hughes]] ([[User talk:Michael Hughes|talk]]) 21:42, 3 June 2014 (WST)&lt;br /&gt;
&lt;br /&gt;
@Michael: Thanks for the comment! You&#039;re correct that each influences the other; and if you&#039;re seeking to influence us in the direction of a holistic approach to that kind of thing, I agree completely. While we&#039;re still in early discussions, it&#039;s envisaged that placing more control in course formats would help to ameliorate this, for example:&lt;br /&gt;
&lt;br /&gt;
* instead of a naive week-on-week course format, we could have a format that groups future weeks by the month&lt;br /&gt;
* instead of a list of activity subject areas, we could have a format that displays subject areas in a square or hex grid&lt;br /&gt;
&lt;br /&gt;
Anything&#039;s possible! --[[User:Jetha Chan|Jetha Chan]] ([[User talk:Jetha Chan|talk]]) 17:04, 5 June 2014 (WST)&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Navigation_overhaul_specification&amp;diff=45145</id>
		<title>Talk:Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Navigation_overhaul_specification&amp;diff=45145"/>
		<updated>2014-06-05T09:00:41Z</updated>

		<summary type="html">&lt;p&gt;Jethac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;. We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
IMHO Scroll of death is more having so much content in a linear layout that it&#039;s impossible to navigate, rather than there being too many nodes in either of the blocks. However both influence each other:&lt;br /&gt;
Lots of content in a straight list introduces navigation issues, however if the navigation only presents straight lists then likely to get content that simply reinforces it --[[User:Michael Hughes|Michael Hughes]] ([[User talk:Michael Hughes|talk]]) 21:42, 3 June 2014 (WST)&lt;br /&gt;
&lt;br /&gt;
@Michael: Thanks for the comment! You&#039;re correct that each influences the other; and if you&#039;re seeking to influence us in the direction of a holistic approach to that kind of thing, I agree completely. While we&#039;re still in early discussions, it&#039;s envisaged that placing more control in course formats would help to ameliorate this, for example:&lt;br /&gt;
&lt;br /&gt;
* instead of a naive week-on-week course format, we could have a format that groups future weeks by the month&lt;br /&gt;
* instead of a list of activity subject areas, we could have a format that displays subject areas in a square or hex grid&lt;br /&gt;
&lt;br /&gt;
Anything&#039;s possible!&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45077</id>
		<title>Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45077"/>
		<updated>2014-05-30T09:33:53Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* User context */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Renderer consistency&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = https://tracker.moodle.org/browse/MDL-45774&lt;br /&gt;
|discussion = -&lt;br /&gt;
|assignee = Frédéric Massart, Jetha Chan&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
Navigation throughout Moodle is often confusing and needs some improvement. With this in mind, a specification has been prepared, defining what problems were identified and how they will be solved. Particular focus will be placed upon improving the experience of students, teachers, and users unfamiliar to Moodle.&lt;br /&gt;
&lt;br /&gt;
== What can be improved ==&lt;br /&gt;
&lt;br /&gt;
Common complaints leveled at Moodle include:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unnecessary steep learning curve&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Features or options not being discovered&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;General frustration&#039;&#039;&#039; - clunkiness, a certain &#039;&#039;je ne sais quoi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The navigation is not static ===&lt;br /&gt;
&lt;br /&gt;
Sometimes when navigating from one place to another, the state of the tree in the navigation block completely changes. A good example of this is when going from a course to a module - upon arrival in a module, the Administration block will display a collapsed &#039;Course administration&#039; node and a new expanded &#039;Module administration&#039; node, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
[[File:pbnotstatic.png|frame|none|alt=Going from course to a module.|Going from course to a module.]]&lt;br /&gt;
&lt;br /&gt;
Consistency should be improved here, as it is unlikely that a user unfamiliar with the system will understand sudden collapsing of or additional nodes.&lt;br /&gt;
&lt;br /&gt;
=== Feature placement ===&lt;br /&gt;
&lt;br /&gt;
It is our opinion that some navigation nodes contain things that you wouldn&#039;t expect, and don&#039;t contain things that you &#039;&#039;&#039;would&#039;&#039; expect. For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;My profile settings&#039; contains &#039;Blogs&#039;, &#039;Badges&#039; or &#039;Messaging&#039;. These are not strictly related to your profile, they are related to your user account.&lt;br /&gt;
* What can be found under &#039;Site pages&#039;?&lt;br /&gt;
* Notes&lt;br /&gt;
** In order to view Notes taken on a course level, I first need to click on &#039;Participants&#039;, and once the page is loaded I can see new entries in the navigation node &#039;Participants&#039;. Why is this the case? Most users will not be aware of those links and will miss out on that feature, we feel.&lt;br /&gt;
&lt;br /&gt;
=== Bad naming ===&lt;br /&gt;
&lt;br /&gt;
Proper naming of the navigation helps the user remembering where to find what they are looking for. It also helps them to discover features that they would not otherwise be aware of, e.g. &#039;Calendar&#039;, hidden under &#039;Site pages&#039;. If a user has no understanding of what &#039;Site pages&#039; is, it is unlikely that they will expand it.&lt;br /&gt;
&lt;br /&gt;
Another popular(?) example of bad naming is the link &#039;My grades&#039; under &#039;Course administration&#039; in the &#039;Administration&#039; block. &#039;A student is not administrating anything, his grades are not a setting.&#039;&lt;br /&gt;
&lt;br /&gt;
=== Context jumps ===&lt;br /&gt;
&lt;br /&gt;
The breadcrumb and navigation sometimes jump from one context to another. For instance, as a student when you click on &#039;Administration &amp;gt; Course administration &amp;gt; My grades&#039;, the navigation node on which you appear to be after clicking is &#039;Administration &amp;gt; Grade administration &amp;gt; User report&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps.png|frame|none|alt=Breadcrumb context jumping.|Breadcrumb context jumping.]]&lt;br /&gt;
&lt;br /&gt;
It is also possible for the user to jump from a course context to a site context, leaving the course (different breadcrumb, different navigation) without realising it and instantly feeling lost. A common reaction would be to use the &#039;Back&#039; button of their browser to recover from it rather than trying to understand what happened. This behaviour can be observed when visiting someone&#039;s profile, viewing some reports, etc...&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps2.png|frame|none|alt=Navigation context jumping.|Navigation context jumping.]]&lt;br /&gt;
&lt;br /&gt;
In order for users to feel comfortable and confident, and to not feel lost in Moodle&#039;s complex page hierarchy, we need to prevent situations where they feel lost and frustrated.&lt;br /&gt;
&lt;br /&gt;
=== Overwhelming the user ===&lt;br /&gt;
&lt;br /&gt;
Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;.  We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&lt;br /&gt;
&lt;br /&gt;
== The goal ==&lt;br /&gt;
&lt;br /&gt;
We seek to provide navigation that is:&lt;br /&gt;
&lt;br /&gt;
* Simpler&lt;br /&gt;
* Intuitive&lt;br /&gt;
* Easy to learn&lt;br /&gt;
&lt;br /&gt;
Leading to myriad benefits, including but not limited to:&lt;br /&gt;
&lt;br /&gt;
; Efficiency&lt;br /&gt;
: Less trial and error when looking for something&lt;br /&gt;
; Common expectations being met&lt;br /&gt;
: Pages being found where you expect them to be&lt;br /&gt;
; A reduction in confusion and general frustration&lt;br /&gt;
; Less resistance&lt;br /&gt;
: New users feeling more confident using the product&lt;br /&gt;
&lt;br /&gt;
Some risk does present itself; by changing large sections of the product, we risk alienating existing experienced Moodle users, frustrated at not finding pages where they used to be. On the other hand, re-learning the navigation should be straightforward, painless and at the very least easier than learning it the first time. User documentation will also suffer in the interim, as screenshots, navigation patterns and other training materials will have to be updated.&lt;br /&gt;
&lt;br /&gt;
== Rough ideas ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of ideas gathered from discussions and resources both internal and external to HQ:&lt;br /&gt;
&lt;br /&gt;
* A student should be able to quickly access his courses, grades, settings, profile from a static place in the UI. This would remove the need for them to expand nodes in both the &#039;Navigation&#039; block and the &#039;Administration&#039; block.&lt;br /&gt;
* The different nodes of the &#039;Administration&#039; block could be displayed on a &#039;Preferences&#039; page.&lt;br /&gt;
** e.g. the &#039;Course administration&#039; items could be listed on a page, each node being a title and each of its elements listed underneath. By moving administration settings to a single page, we obviate the need for the &#039;Administration&#039; block entirely.&lt;br /&gt;
* A teacher should be able to quickly access the &#039;Options&#039; of a course through a static node, the same way a user can access anything associated to his account.&lt;br /&gt;
* Similarly for modules, an easy dropdown to access module preferences and more frequently used options could be created.&lt;br /&gt;
* Breadcrumb-based navigation to reduce and perhaps entirely remove the the need for the nested and cumbersome Navigation block.&lt;br /&gt;
** This could be problematic in regards to creating problems with accessing site pages, or pages which do not clearly have a hierarchical position.  This could be addressed by providing &#039;in context&#039; links. For instance, adding a new block entry should be available from the Blog page.&lt;br /&gt;
* Providing a sitemap page to counter the lack of &#039;Navigation&#039; block when something is not easily accessible.&lt;br /&gt;
* Ability to &#039;Star&#039; some pages to quickly access favourites.&lt;br /&gt;
* Develop a &#039;Smart search&#039; to easily access the content in the current course, other courses, etc… and the admin settings for admins.&lt;br /&gt;
* Populating my/ page with more useful content for the user itself.&lt;br /&gt;
* A new profile page on which is displayed the &#039;public&#039; information of the user. Their forum interactions, their blog, their reports, ...&lt;br /&gt;
* Providing an API to modules to implement their own navigation, thus not required to inject links in the navigation block like &#039;Chat&#039; is doing or &#039;Quiz&#039; used to do (Results report). This navigation would be displayed in a standard fashion across modules. (Tabs like in wiki?)&lt;br /&gt;
* When hovering a user&#039;s name, a menu could appear with a few details and links to their profile, etc... (like Jira does).&lt;br /&gt;
&lt;br /&gt;
== Analysis of popular themes ==&lt;br /&gt;
&lt;br /&gt;
Although most of those themes do not change anything about the navigation itself, a few have implemented a &#039;&#039;user menu&#039;&#039;. Usually displayed at the top most right of the screen, it contains links to quickly access user specific pages. The most common links are:&lt;br /&gt;
&lt;br /&gt;
* View profile&lt;br /&gt;
* Edit profile&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
Less popular links are:&lt;br /&gt;
&lt;br /&gt;
* Calendar&lt;br /&gt;
* My private files&lt;br /&gt;
* My home&lt;br /&gt;
&lt;br /&gt;
== The solutions ==&lt;br /&gt;
&lt;br /&gt;
To achieve our goal we have to remove the need for the administration and navigation blocks. This is a long process that needs to be broken down into sub-solutions. Some will need to be developed simultaneously to avoid half-baked temporary solutions. Those solutions can be split into two categories: &#039;User&#039;, and &#039;Course&#039;.&lt;br /&gt;
&lt;br /&gt;
User solutions:&lt;br /&gt;
&lt;br /&gt;
* A user menu&lt;br /&gt;
* A user preferences page&lt;br /&gt;
* A new profile page&lt;br /&gt;
* Revisiting &#039;My home&#039; page&lt;br /&gt;
&lt;br /&gt;
Course solutions:&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* A course &#039;Quick access&#039; menu&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
&lt;br /&gt;
The user menu is a dropdown containing links to pages specific to user. They are context independent and will always point to the same pages. The user menu can always be found at the same place in the user interface and will contain the following links:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* My grades&lt;br /&gt;
* Messages&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
[[File:usermenu.png|frame|none|alt=A user menu.|A user menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Gives quick and intuitive access to the user specific pages&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Emphasises the page &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== User preferences page ===&lt;br /&gt;
&lt;br /&gt;
A link to that page would be placed in the user menu. That page will contain most of what the user has control over on a site level. Their mailing preferences, changing their password, etc... but reorganised.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* We can remove &#039;My profile settings&#039; from the &#039;Administration&#039; block.&lt;br /&gt;
* The settings are all reachable from one place.&lt;br /&gt;
* New pages will help the user understanding what settings they have control over.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
By adding new content to the profile page, we can trim a bit more the navigation block. The profile page is supposed to contain anything you could find about a user, and there will be links to their blog, forum interactions, notes, to send them a message, etc...&lt;br /&gt;
&lt;br /&gt;
We will keep the distinction between the full profile and the course profiles, at this stage we only improve the site profile because the course profiles need more thoughts and are tied to the course solutions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Answering concerns of the &#039;User preferences page&#039;&lt;br /&gt;
* Bonus: the profile page has a reason to be visited&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
The My/ page is underused and does not contain enough valuable information for the users to visit it. We will update it to include more user-specific content. It will contain:&lt;br /&gt;
&lt;br /&gt;
* My courses&lt;br /&gt;
* My private files&lt;br /&gt;
* The calendar and upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
[[File:myhome.png|frame|none|alt=The new dashboard.|The new dashboard.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;, at this point it should be empty&lt;br /&gt;
* Making the my/ page more interesting and valuable&lt;br /&gt;
&lt;br /&gt;
=== Handling of course profiles ===&lt;br /&gt;
&lt;br /&gt;
We need to remove the confusion between site and course profiles, only a few more informations should be available when viewing a &#039;Course profile&#039;, but we do not need an entirely different profile for that purpose. The course specific information will be accessible from the user profile, but be in the context of the site profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No more course profile pages&lt;br /&gt;
&lt;br /&gt;
=== A course &#039;Quick access&#039; menu ===&lt;br /&gt;
&lt;br /&gt;
In order to remove the need for the nodes &#039;Participants&#039; and &#039;Badges&#039; from the &#039;Course&#039; entry in the &#039;Navigation block&#039;, and the &#039;Grades&#039; entry in the &#039;Course administration&#039; node (for students), we will implement a new &#039;Quick access&#039; menu for the course. This menu will be accessible on any page within a course, or module.&lt;br /&gt;
&lt;br /&gt;
This menu will only contain links to the 3 entries mentioned above. If later on we add more links to that list, the additional (and less important) entries will be displayed in a dropdown, or a in a &#039;More&#039; page.&lt;br /&gt;
&lt;br /&gt;
A new grades page will be created for students to access their course grades.&lt;br /&gt;
&lt;br /&gt;
It is important to keep the visible elements of this menu to a minimum. Not more than 3 elements should be displayed at a time. An exception can be made for users with more privileges who will see a &#039;Settings&#039; (or &#039;Administration&#039;) link, and perhaps a &#039;Reports&#039; one when we will work on them (see the following the other solutions below).&lt;br /&gt;
&lt;br /&gt;
To unenrol yourself from a course, you would not look into the &#039;Course administration&#039; node, you would rather find a link on &#039;My home&#039; page next to the list of courses to unenrol yourself from them.&lt;br /&gt;
&lt;br /&gt;
[[File:coursemenu.png|frame|none|alt=An example of a course quick-access menu.|An example of a course quick-access menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming the navigation block&lt;br /&gt;
* Removing the &#039;Course administration&#039; node for students&lt;br /&gt;
* Dedicated grades page for the students&lt;br /&gt;
* Quick access to the most important pages of a course&lt;br /&gt;
&lt;br /&gt;
=== An administration page per module ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the module would list everything that was originally in the &#039;Module administration&#039; node, but reorganised to be more intuitive. A link to that page would be placed somewhere in the general UI.&lt;br /&gt;
&lt;br /&gt;
Modules currently using the &#039;Adminstration&#039; block to inject new pages into their module should be updated to provide a module navigation instead. It could be a list of links in the module page, or a module navigation such as tabs, this is probably tied to the solution &#039;Alternative site and course navigation&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the module administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* Removes the need for the &#039;Module administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
&lt;br /&gt;
=== An administration page for the course ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the course would list everything that was originally in the &#039;Course administration&#039; node, but reorganised to be more intuitive. A link to that page will be added to the course &#039;Quick access&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the course administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* No more &#039;Course administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
* Reports would be accessible from that page until &#039;Dedicated solution to access reports&#039; is implemented&lt;br /&gt;
&lt;br /&gt;
=== Dedicated solution to access reports ===&lt;br /&gt;
&lt;br /&gt;
Reports are the black sheep of the navigation, nobody agrees on where they should be and they are moved around every so often. Perhaps nobody agrees because they do not belong either in the navigation or the administration block.&lt;br /&gt;
&lt;br /&gt;
Currently they are accessed from the &#039;Administration&#039; block, and as we are moving the content of the block to administration pages, that is where they will end up. This is surely not better (perhaps even worse) than where they were before, so why not thinking once and for all where they should be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/!\ Solution needed!&lt;br /&gt;
&lt;br /&gt;
Idea: We could add a &#039;Report&#039; menu to the course &#039;Quick access&#039; menu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Standardised way to access reports&lt;br /&gt;
* A navigation that does not jump somewhere else when viewing a report&lt;br /&gt;
&lt;br /&gt;
=== Alternative site and course navigation ===&lt;br /&gt;
&lt;br /&gt;
Now that everything has been sorted out, we should now be able to remove the navigation block - but first we&#039;ll need to sort out how to navigate at both the site and course levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Site level&#039;&#039;&#039;&lt;br /&gt;
It is envisaged that the frontpage would just be an entry point, with the navigation node &#039;Site pages&#039; displayed in a block specific to those site pages. Upon leaving the context of the &#039;Site&#039;, you will be in a course; most users will not go back to the front page, except to find some information specific to their institution. To navigate between their courses, teachers and students could refer to their my/ page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, pages like &#039;Participants&#039;, &#039;Badges&#039; or &#039;Tags&#039; could be accessed from their context, for instance in a &#039;Online users&#039; block which would link to &#039;All participants&#039;. The same applies for &#039;Calendar&#039;, but is already the case because of its block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course level&#039;&#039;&#039;&lt;br /&gt;
The site-level concept should disappear as soon as you get in a course; the student or teacher would then focus 100% on the course they are browsing rather than being distracted by site elements. This behavior is currently exhibited by the base and standard themes in 2.6 and before.&lt;br /&gt;
&lt;br /&gt;
The course format will become responsible for most of the navigation in the course, allowing course formats to:&lt;br /&gt;
&lt;br /&gt;
* Inject block(s) to navigate between sections&lt;br /&gt;
* Inject block(s) to navigate between modules&lt;br /&gt;
* Inject block(s) that does/do both of the above (very similar to the course node in the navigation block)&lt;br /&gt;
* Inject links &#039;Go to next activity&#039;, &#039;Go back to course&#039;, ... into module views.&lt;br /&gt;
&lt;br /&gt;
The course format will also have control over the course &#039;Quick access&#039; menu, in which it could inject/remove items if they wanted to.&lt;br /&gt;
&lt;br /&gt;
The node &#039;Switch role&#039; will be removed from the administration block, necessitating a &#039;Switch role&#039; block to be added to the course to unlock that functionality. This block would only be displayed to users having the capabilities to switch role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Future of the Administration block&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, the administration block will not be displayed to any user, except those users possessing elevated privileges. Administrators, managers or course creators will still have access to the administration block but it will only contain the &#039;Site administration&#039; node.&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
All the pages in a user context will have their own layout wherein the header includes the name of the user in a standardised way, along with some information and a link to message them, and their preferences if the logged in user has the capabilities to edit them. A renderer will be responsible for creating the header, and will use the user ID found from the context defined on that page.&lt;br /&gt;
&lt;br /&gt;
The navigation within the context pages will be:&lt;br /&gt;
&lt;br /&gt;
; For your own context&lt;br /&gt;
: Home &amp;gt; Your Name &amp;gt; Page you are on. Clicking on &#039;Your Name&#039; will lead you to &#039;My home&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader.png|frame|none|alt=The header when viewing your context.|The header when your context.]]&lt;br /&gt;
&lt;br /&gt;
; For other users&#039; context&lt;br /&gt;
: Home &amp;gt; Users &amp;gt; User Name &amp;gt; Page you are on. Clicking on &#039;User Name&#039; will lead you to their profile.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader2.png|frame|none|alt=The header when viewing someone else&#039;s context.|The header when viewing someone else&#039;s context.]]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The user header contains very simplistic information about the user, and a few links to very common actions in regard to other users. For instance it can implement a link to send a message to the user, because you might want to be able to do that regardless of what user context page you are visiting. But, &#039;Edit profile&#039; should not be in it, because it is only relevant to the profile. It is very important to keep the number of available actions to a minimum, because having too many options would defeat the purpose of the simplicity and efficiency it is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== A user menu ===&lt;br /&gt;
&lt;br /&gt;
The new user menu would be a new renderer, called from the layout files as it was the case for the login info renderer. The content of the user menu is fixed and not configurable, however it is possible to override the renderer from a theme to change its layout and content.&lt;br /&gt;
&lt;br /&gt;
==== Design ====&lt;br /&gt;
&lt;br /&gt;
Placed on the top right of the site, the name of the user is displayed next to a user icon. The dropdown is displayed when the user clicks the icon or the name. On smaller screens only a user icon is displayed, and expands to reveal its content. When expanded the name of the user logged in is displayed.&lt;br /&gt;
&lt;br /&gt;
When the user is not logged in, a login link is displayed, regardless of the screen size.&lt;br /&gt;
&lt;br /&gt;
==== My grades ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My grades&#039; page will display the overall grades of the student in all their visible courses. The ordering can be changed, but the default would be alphabetical.&lt;br /&gt;
&lt;br /&gt;
==== Login as ====&lt;br /&gt;
&lt;br /&gt;
When logged in as someone else, the &#039;Logout&#039; entry becomes &#039;Return to Admin User&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Switch role ====&lt;br /&gt;
&lt;br /&gt;
When the user role is switched, the &#039;Logout&#039; entry becomes &#039;Return to my normal role&#039;. And the name of the user is appended with the role they switch to, e.g. &#039;Admin User (teacher)&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Trimming navigation ====&lt;br /&gt;
&lt;br /&gt;
At this stage we could trim the navigation block, but we decide not to remove anything just yet as it would create more confusion: some nodes would accessible from the user menu, and others from the navigation block.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
For it to be used, the user menu needs to be as short as possible and not being cluttered with additional links. It should contain what has been decided upon above, and not be changed - as users will acclimatise to it, adding and removing nodes should not be looked upon lightly. In any case, it should not contain more than 6 links, and should always contain:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* Preferences&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
These are very important to the user as they target user context-specific pages and nothing related to the site structure or the course. A link to &#039;My courses&#039; would be redundant as this information should be covered in the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
=== A user preferences page ===&lt;br /&gt;
&lt;br /&gt;
The preferences page is a list of links to sub-preferences page. The page will be generated from the navigation node &#039;My profile settings&#039;, though we will have to re-organise them so that each link belongs to a parent node. A link to the preferences page is added to the user menu.&lt;br /&gt;
&lt;br /&gt;
==== Re-organisation ====&lt;br /&gt;
&lt;br /&gt;
* User account&lt;br /&gt;
** Edit profile&lt;br /&gt;
** Account settings&lt;br /&gt;
** Change password&lt;br /&gt;
** Security keys&lt;br /&gt;
** Messaging&lt;br /&gt;
&lt;br /&gt;
* Blogs&lt;br /&gt;
** Preferences&lt;br /&gt;
** External blogs&lt;br /&gt;
** Register an external blog&lt;br /&gt;
&lt;br /&gt;
* Badges&lt;br /&gt;
** Manage my badges&lt;br /&gt;
** Preferences&lt;br /&gt;
** Backpack settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preferences page displays headings (the setting nodes) under which the links to the sub-pages will be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
The nodes &#039;Roles&#039; and &#039;Activity reports&#039; will not be part of this page, because they are context based: they point to the course or site context depending on the page we are on. They will remain in the navigation block, but only when the user has the capability to view them. When the only node in the &#039;My profile settings&#039; node is &#039;Preferences&#039;, then &#039;My profile settings&#039; is not displayed. Here is an example when you have the capability to view the reports and roles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblockpref.png|frame|none|alt=My profile settings node with extended capability.|My profile settings node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My profile settings&#039; node becomes the name of the user: &#039;Frédéric Massart&#039;. The &#039;Profile settings for Jetha Chan&#039; becomes &#039;Jetha Chan&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breadcrumb ====&lt;br /&gt;
&lt;br /&gt;
Each of the sub-pages should be checked to ensure that they are in the right hierarchy, the breadcrumb always looks like &#039;(User context nav) &amp;gt; Preferences &amp;gt; Preference heading &amp;gt; Page I am on&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Another user&#039;s preferences ====&lt;br /&gt;
&lt;br /&gt;
The node &#039;Profile settings for User B&#039; can be used to edit someone&#039;s settings. The content is similar to &#039;My profile settings&#039;, except that the node will always be displayed regardless of the presence of &#039;Roles&#039; or &#039;Activity reports&#039;. Currently there is no other way for a user with elevated privileges to access someone&#039;s preferences, but sooner or later the preferences will be accessible from their profiles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblocksomeonelse.png|frame|none|alt=Profile settings for X with extended capability.|Profile settings for X node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Repositories ====&lt;br /&gt;
&lt;br /&gt;
At present, repositories are configurable from the Navigation block - this is a good opportunity to move them to the &#039;Preferences&#039; page.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
Every link in this page should belong to a section, the sections are only headers that help the users finding what they are looking for. A plugin that adds user preferences related to its features should define a new heading and add its links to that heading. The heading is never clickable.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
For now we will only be focussing on the site profile of the user. Later on, we will be solving the problems linked to the course context, for instances the links to &#039;Blog&#039; or &#039;Forum interactions&#039; automatically filtered to only display the blog posts in the course.&lt;br /&gt;
&lt;br /&gt;
==== Content ====&lt;br /&gt;
&lt;br /&gt;
The contact details will be displayed in such a way that they do not look like a list any more. For instance, everyone knows what an email address is, there is no need to prefix it with &#039;Email address:&#039;.&lt;br /&gt;
&lt;br /&gt;
The badges will be displayed on the profile too.&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&lt;br /&gt;
* Edit profile (If this is your profile)&lt;br /&gt;
* Blog&lt;br /&gt;
* Forum interactions&lt;br /&gt;
* Notes (If you have the capability to)&lt;br /&gt;
* Preferences (If you have the capability to and are viewing someone&#039;s profile)&lt;br /&gt;
* Send a message&lt;br /&gt;
* Login as (If you have the capability to)&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can start trimming the node &#039;My profile&#039; a bit, but some nodes will remain until we sort out the &#039;My&#039; page. When doing so, it is important to make sure that the nodes &#039;Home &amp;gt; Some course &amp;gt; Participants &amp;gt; User B&#039; still contain everything it does right now, because those links point to course-based pages, and would not be accessible otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The profile page contains everything about the user that is public. In other words, a content specific to the user should not be displayed on the profile at all, because it would never be accessible to another user, e.g. &#039;Private files&#039;.&lt;br /&gt;
&lt;br /&gt;
There are exceptions to this rule, badges for example. As a setting allows you to define whether or not your badges are on your profile, you might not be able to see them there, so they should be available on your dashboard.&lt;br /&gt;
&lt;br /&gt;
For content controlled by permissions (and not preferences), they should remain on the profile. Take &#039;Blog&#039; as an example, an administrator can prevent blog entries from another user to be accessed depending on your role. As the user does not have any information about the roles of the other users, the blog link is displayed on the profile, but other users will not see it. Having a blog block on the &#039;My home&#039; page would not be useful because it simply duplicates the access points, for no apparent reason to the user.&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
We need to add more default blocks to the existing page, the different available blocks will be:&lt;br /&gt;
&lt;br /&gt;
* My courses (already there)&lt;br /&gt;
* My private files (already there)&lt;br /&gt;
* The calendar&lt;br /&gt;
* Upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
We need to add a link to &#039;My latest badges&#039; to the page listing all the badges.&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can now remove &#039;My profile&#039; (or now called &#039;Jetha Chan&#039;) from the navigation block entirely. But it has to still be accessible under the node of a user in a course tree.&lt;br /&gt;
&lt;br /&gt;
The node &#039;My courses&#039; is also removed, users should be used to using their dashboard to access their courses.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My home&#039; page contains everything about a user that is private and not accessible to other users. For instance, your calendar events or your private files. The list of courses you are enrolled in are an exception, they could be displayed on the user profile, but because they are so important and need to be layed out in useful fashion, they will be part of the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
This page does not need to link to pages which are already accessible from the &#039;User menu&#039;, for instance the profile.&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pending&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Accessing course grades for students&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
** Checking for inconsistencies in the breadcrumb jumping from one place to another.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
# The user menu&lt;br /&gt;
# Implementing the user &#039;header&#039; for user context pages&lt;br /&gt;
# The preferences page&lt;br /&gt;
# The new profile page&lt;br /&gt;
# Revisiting &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;To be defined.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.google.com/document/d/16BJsINun13StUFOQaejj3Gawz9jk22ir_r49f3MbInM/edit#heading=h.fuvsbkikzj88 Navigation experiment]&lt;br /&gt;
* [https://docs.google.com/document/d/1AXJw8uX6MczA5VC3phkVVv1ee5eZ2nluIiPC2ecgHLE/edit#heading=h.k3lh9alzq3iy Navigation prototyping 2.7]&lt;br /&gt;
* MDL-34838: Navigation inconsistencies&lt;br /&gt;
* [http://demo2k12.moodlerooms.com Minimal by Moodlerooms]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226791 Users’ personalised profiles]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45076</id>
		<title>Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45076"/>
		<updated>2014-05-30T09:27:01Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* An administration page per module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Renderer consistency&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = https://tracker.moodle.org/browse/MDL-45774&lt;br /&gt;
|discussion = -&lt;br /&gt;
|assignee = Frédéric Massart, Jetha Chan&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
Navigation throughout Moodle is often confusing and needs some improvement. With this in mind, a specification has been prepared, defining what problems were identified and how they will be solved. Particular focus will be placed upon improving the experience of students, teachers, and users unfamiliar to Moodle.&lt;br /&gt;
&lt;br /&gt;
== What can be improved ==&lt;br /&gt;
&lt;br /&gt;
Common complaints leveled at Moodle include:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unnecessary steep learning curve&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Features or options not being discovered&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;General frustration&#039;&#039;&#039; - clunkiness, a certain &#039;&#039;je ne sais quoi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The navigation is not static ===&lt;br /&gt;
&lt;br /&gt;
Sometimes when navigating from one place to another, the state of the tree in the navigation block completely changes. A good example of this is when going from a course to a module - upon arrival in a module, the Administration block will display a collapsed &#039;Course administration&#039; node and a new expanded &#039;Module administration&#039; node, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
[[File:pbnotstatic.png|frame|none|alt=Going from course to a module.|Going from course to a module.]]&lt;br /&gt;
&lt;br /&gt;
Consistency should be improved here, as it is unlikely that a user unfamiliar with the system will understand sudden collapsing of or additional nodes.&lt;br /&gt;
&lt;br /&gt;
=== Feature placement ===&lt;br /&gt;
&lt;br /&gt;
It is our opinion that some navigation nodes contain things that you wouldn&#039;t expect, and don&#039;t contain things that you &#039;&#039;&#039;would&#039;&#039; expect. For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;My profile settings&#039; contains &#039;Blogs&#039;, &#039;Badges&#039; or &#039;Messaging&#039;. These are not strictly related to your profile, they are related to your user account.&lt;br /&gt;
* What can be found under &#039;Site pages&#039;?&lt;br /&gt;
* Notes&lt;br /&gt;
** In order to view Notes taken on a course level, I first need to click on &#039;Participants&#039;, and once the page is loaded I can see new entries in the navigation node &#039;Participants&#039;. Why is this the case? Most users will not be aware of those links and will miss out on that feature, we feel.&lt;br /&gt;
&lt;br /&gt;
=== Bad naming ===&lt;br /&gt;
&lt;br /&gt;
Proper naming of the navigation helps the user remembering where to find what they are looking for. It also helps them to discover features that they would not otherwise be aware of, e.g. &#039;Calendar&#039;, hidden under &#039;Site pages&#039;. If a user has no understanding of what &#039;Site pages&#039; is, it is unlikely that they will expand it.&lt;br /&gt;
&lt;br /&gt;
Another popular(?) example of bad naming is the link &#039;My grades&#039; under &#039;Course administration&#039; in the &#039;Administration&#039; block. &#039;A student is not administrating anything, his grades are not a setting.&#039;&lt;br /&gt;
&lt;br /&gt;
=== Context jumps ===&lt;br /&gt;
&lt;br /&gt;
The breadcrumb and navigation sometimes jump from one context to another. For instance, as a student when you click on &#039;Administration &amp;gt; Course administration &amp;gt; My grades&#039;, the navigation node on which you appear to be after clicking is &#039;Administration &amp;gt; Grade administration &amp;gt; User report&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps.png|frame|none|alt=Breadcrumb context jumping.|Breadcrumb context jumping.]]&lt;br /&gt;
&lt;br /&gt;
It is also possible for the user to jump from a course context to a site context, leaving the course (different breadcrumb, different navigation) without realising it and instantly feeling lost. A common reaction would be to use the &#039;Back&#039; button of their browser to recover from it rather than trying to understand what happened. This behaviour can be observed when visiting someone&#039;s profile, viewing some reports, etc...&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps2.png|frame|none|alt=Navigation context jumping.|Navigation context jumping.]]&lt;br /&gt;
&lt;br /&gt;
In order for users to feel comfortable and confident, and to not feel lost in Moodle&#039;s complex page hierarchy, we need to prevent situations where they feel lost and frustrated.&lt;br /&gt;
&lt;br /&gt;
=== Overwhelming the user ===&lt;br /&gt;
&lt;br /&gt;
Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;.  We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&lt;br /&gt;
&lt;br /&gt;
== The goal ==&lt;br /&gt;
&lt;br /&gt;
We seek to provide navigation that is:&lt;br /&gt;
&lt;br /&gt;
* Simpler&lt;br /&gt;
* Intuitive&lt;br /&gt;
* Easy to learn&lt;br /&gt;
&lt;br /&gt;
Leading to myriad benefits, including but not limited to:&lt;br /&gt;
&lt;br /&gt;
; Efficiency&lt;br /&gt;
: Less trial and error when looking for something&lt;br /&gt;
; Common expectations being met&lt;br /&gt;
: Pages being found where you expect them to be&lt;br /&gt;
; A reduction in confusion and general frustration&lt;br /&gt;
; Less resistance&lt;br /&gt;
: New users feeling more confident using the product&lt;br /&gt;
&lt;br /&gt;
Some risk does present itself; by changing large sections of the product, we risk alienating existing experienced Moodle users, frustrated at not finding pages where they used to be. On the other hand, re-learning the navigation should be straightforward, painless and at the very least easier than learning it the first time. User documentation will also suffer in the interim, as screenshots, navigation patterns and other training materials will have to be updated.&lt;br /&gt;
&lt;br /&gt;
== Rough ideas ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of ideas gathered from discussions and resources both internal and external to HQ:&lt;br /&gt;
&lt;br /&gt;
* A student should be able to quickly access his courses, grades, settings, profile from a static place in the UI. This would remove the need for them to expand nodes in both the &#039;Navigation&#039; block and the &#039;Administration&#039; block.&lt;br /&gt;
* The different nodes of the &#039;Administration&#039; block could be displayed on a &#039;Preferences&#039; page.&lt;br /&gt;
** e.g. the &#039;Course administration&#039; items could be listed on a page, each node being a title and each of its elements listed underneath. By moving administration settings to a single page, we obviate the need for the &#039;Administration&#039; block entirely.&lt;br /&gt;
* A teacher should be able to quickly access the &#039;Options&#039; of a course through a static node, the same way a user can access anything associated to his account.&lt;br /&gt;
* Similarly for modules, an easy dropdown to access module preferences and more frequently used options could be created.&lt;br /&gt;
* Breadcrumb-based navigation to reduce and perhaps entirely remove the the need for the nested and cumbersome Navigation block.&lt;br /&gt;
** This could be problematic in regards to creating problems with accessing site pages, or pages which do not clearly have a hierarchical position.  This could be addressed by providing &#039;in context&#039; links. For instance, adding a new block entry should be available from the Blog page.&lt;br /&gt;
* Providing a sitemap page to counter the lack of &#039;Navigation&#039; block when something is not easily accessible.&lt;br /&gt;
* Ability to &#039;Star&#039; some pages to quickly access favourites.&lt;br /&gt;
* Develop a &#039;Smart search&#039; to easily access the content in the current course, other courses, etc… and the admin settings for admins.&lt;br /&gt;
* Populating my/ page with more useful content for the user itself.&lt;br /&gt;
* A new profile page on which is displayed the &#039;public&#039; information of the user. Their forum interactions, their blog, their reports, ...&lt;br /&gt;
* Providing an API to modules to implement their own navigation, thus not required to inject links in the navigation block like &#039;Chat&#039; is doing or &#039;Quiz&#039; used to do (Results report). This navigation would be displayed in a standard fashion across modules. (Tabs like in wiki?)&lt;br /&gt;
* When hovering a user&#039;s name, a menu could appear with a few details and links to their profile, etc... (like Jira does).&lt;br /&gt;
&lt;br /&gt;
== Analysis of popular themes ==&lt;br /&gt;
&lt;br /&gt;
Although most of those themes do not change anything about the navigation itself, a few have implemented a &#039;&#039;user menu&#039;&#039;. Usually displayed at the top most right of the screen, it contains links to quickly access user specific pages. The most common links are:&lt;br /&gt;
&lt;br /&gt;
* View profile&lt;br /&gt;
* Edit profile&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
Less popular links are:&lt;br /&gt;
&lt;br /&gt;
* Calendar&lt;br /&gt;
* My private files&lt;br /&gt;
* My home&lt;br /&gt;
&lt;br /&gt;
== The solutions ==&lt;br /&gt;
&lt;br /&gt;
To achieve our goal we have to remove the need for the administration and navigation blocks. This is a long process that needs to be broken down into sub-solutions. Some will need to be developed simultaneously to avoid half-baked temporary solutions. Those solutions can be split into two categories: &#039;User&#039;, and &#039;Course&#039;.&lt;br /&gt;
&lt;br /&gt;
User solutions:&lt;br /&gt;
&lt;br /&gt;
* A user menu&lt;br /&gt;
* A user preferences page&lt;br /&gt;
* A new profile page&lt;br /&gt;
* Revisiting &#039;My home&#039; page&lt;br /&gt;
&lt;br /&gt;
Course solutions:&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* A course &#039;Quick access&#039; menu&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
&lt;br /&gt;
The user menu is a dropdown containing links to pages specific to user. They are context independent and will always point to the same pages. The user menu can always be found at the same place in the user interface and will contain the following links:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* My grades&lt;br /&gt;
* Messages&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
[[File:usermenu.png|frame|none|alt=A user menu.|A user menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Gives quick and intuitive access to the user specific pages&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Emphasises the page &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== User preferences page ===&lt;br /&gt;
&lt;br /&gt;
A link to that page would be placed in the user menu. That page will contain most of what the user has control over on a site level. Their mailing preferences, changing their password, etc... but reorganised.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* We can remove &#039;My profile settings&#039; from the &#039;Administration&#039; block.&lt;br /&gt;
* The settings are all reachable from one place.&lt;br /&gt;
* New pages will help the user understanding what settings they have control over.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
By adding new content to the profile page, we can trim a bit more the navigation block. The profile page is supposed to contain anything you could find about a user, and there will be links to their blog, forum interactions, notes, to send them a message, etc...&lt;br /&gt;
&lt;br /&gt;
We will keep the distinction between the full profile and the course profiles, at this stage we only improve the site profile because the course profiles need more thoughts and are tied to the course solutions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Answering concerns of the &#039;User preferences page&#039;&lt;br /&gt;
* Bonus: the profile page has a reason to be visited&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
The My/ page is underused and does not contain enough valuable information for the users to visit it. We will update it to include more user-specific content. It will contain:&lt;br /&gt;
&lt;br /&gt;
* My courses&lt;br /&gt;
* My private files&lt;br /&gt;
* The calendar and upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
[[File:myhome.png|frame|none|alt=The new dashboard.|The new dashboard.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;, at this point it should be empty&lt;br /&gt;
* Making the my/ page more interesting and valuable&lt;br /&gt;
&lt;br /&gt;
=== Handling of course profiles ===&lt;br /&gt;
&lt;br /&gt;
We need to remove the confusion between site and course profiles, only a few more informations should be available when viewing a &#039;Course profile&#039;, but we do not need an entirely different profile for that purpose. The course specific information will be accessible from the user profile, but be in the context of the site profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No more course profile pages&lt;br /&gt;
&lt;br /&gt;
=== A course &#039;Quick access&#039; menu ===&lt;br /&gt;
&lt;br /&gt;
In order to remove the need for the nodes &#039;Participants&#039; and &#039;Badges&#039; from the &#039;Course&#039; entry in the &#039;Navigation block&#039;, and the &#039;Grades&#039; entry in the &#039;Course administration&#039; node (for students), we will implement a new &#039;Quick access&#039; menu for the course. This menu will be accessible on any page within a course, or module.&lt;br /&gt;
&lt;br /&gt;
This menu will only contain links to the 3 entries mentioned above. If later on we add more links to that list, the additional (and less important) entries will be displayed in a dropdown, or a in a &#039;More&#039; page.&lt;br /&gt;
&lt;br /&gt;
A new grades page will be created for students to access their course grades.&lt;br /&gt;
&lt;br /&gt;
It is important to keep the visible elements of this menu to a minimum. Not more than 3 elements should be displayed at a time. An exception can be made for users with more privileges who will see a &#039;Settings&#039; (or &#039;Administration&#039;) link, and perhaps a &#039;Reports&#039; one when we will work on them (see the following the other solutions below).&lt;br /&gt;
&lt;br /&gt;
To unenrol yourself from a course, you would not look into the &#039;Course administration&#039; node, you would rather find a link on &#039;My home&#039; page next to the list of courses to unenrol yourself from them.&lt;br /&gt;
&lt;br /&gt;
[[File:coursemenu.png|frame|none|alt=An example of a course quick-access menu.|An example of a course quick-access menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming the navigation block&lt;br /&gt;
* Removing the &#039;Course administration&#039; node for students&lt;br /&gt;
* Dedicated grades page for the students&lt;br /&gt;
* Quick access to the most important pages of a course&lt;br /&gt;
&lt;br /&gt;
=== An administration page per module ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the module would list everything that was originally in the &#039;Module administration&#039; node, but reorganised to be more intuitive. A link to that page would be placed somewhere in the general UI.&lt;br /&gt;
&lt;br /&gt;
Modules currently using the &#039;Adminstration&#039; block to inject new pages into their module should be updated to provide a module navigation instead. It could be a list of links in the module page, or a module navigation such as tabs, this is probably tied to the solution &#039;Alternative site and course navigation&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the module administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* Removes the need for the &#039;Module administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
&lt;br /&gt;
=== An administration page for the course ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the course would list everything that was originally in the &#039;Course administration&#039; node, but reorganised to be more intuitive. A link to that page will be added to the course &#039;Quick access&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the course administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* No more &#039;Course administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
* Reports would be accessible from that page until &#039;Dedicated solution to access reports&#039; is implemented&lt;br /&gt;
&lt;br /&gt;
=== Dedicated solution to access reports ===&lt;br /&gt;
&lt;br /&gt;
Reports are the black sheep of the navigation, nobody agrees on where they should be and they are moved around every so often. Perhaps nobody agrees because they do not belong either in the navigation or the administration block.&lt;br /&gt;
&lt;br /&gt;
Currently they are accessed from the &#039;Administration&#039; block, and as we are moving the content of the block to administration pages, that is where they will end up. This is surely not better (perhaps even worse) than where they were before, so why not thinking once and for all where they should be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/!\ Solution needed!&lt;br /&gt;
&lt;br /&gt;
Idea: We could add a &#039;Report&#039; menu to the course &#039;Quick access&#039; menu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Standardised way to access reports&lt;br /&gt;
* A navigation that does not jump somewhere else when viewing a report&lt;br /&gt;
&lt;br /&gt;
=== Alternative site and course navigation ===&lt;br /&gt;
&lt;br /&gt;
Now that everything has been sorted out, we should now be able to remove the navigation block - but first we&#039;ll need to sort out how to navigate at both the site and course levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Site level&#039;&#039;&#039;&lt;br /&gt;
It is envisaged that the frontpage would just be an entry point, with the navigation node &#039;Site pages&#039; displayed in a block specific to those site pages. Upon leaving the context of the &#039;Site&#039;, you will be in a course; most users will not go back to the front page, except to find some information specific to their institution. To navigate between their courses, teachers and students could refer to their my/ page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, pages like &#039;Participants&#039;, &#039;Badges&#039; or &#039;Tags&#039; could be accessed from their context, for instance in a &#039;Online users&#039; block which would link to &#039;All participants&#039;. The same applies for &#039;Calendar&#039;, but is already the case because of its block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course level&#039;&#039;&#039;&lt;br /&gt;
The site-level concept should disappear as soon as you get in a course; the student or teacher would then focus 100% on the course they are browsing rather than being distracted by site elements. This behavior is currently exhibited by the base and standard themes in 2.6 and before.&lt;br /&gt;
&lt;br /&gt;
The course format will become responsible for most of the navigation in the course, allowing course formats to:&lt;br /&gt;
&lt;br /&gt;
* Inject block(s) to navigate between sections&lt;br /&gt;
* Inject block(s) to navigate between modules&lt;br /&gt;
* Inject block(s) that does/do both of the above (very similar to the course node in the navigation block)&lt;br /&gt;
* Inject links &#039;Go to next activity&#039;, &#039;Go back to course&#039;, ... into module views.&lt;br /&gt;
&lt;br /&gt;
The course format will also have control over the course &#039;Quick access&#039; menu, in which it could inject/remove items if they wanted to.&lt;br /&gt;
&lt;br /&gt;
The node &#039;Switch role&#039; will be removed from the administration block, necessitating a &#039;Switch role&#039; block to be added to the course to unlock that functionality. This block would only be displayed to users having the capabilities to switch role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Future of the Administration block&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, the administration block will not be displayed to any user, except those users possessing elevated privileges. Administrators, managers or course creators will still have access to the administration block but it will only contain the &#039;Site administration&#039; node.&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
All the pages on a user context will all have their own layout where the header includes the name of the user in a standardised way, along with some information and a link to message them, and their preferences if the logged in user has the capabilities to edit them. A renderer will be responsible for creating the header, and will use the user ID found from the context defined on that page.&lt;br /&gt;
&lt;br /&gt;
The navigation within the context pages will be:&lt;br /&gt;
&lt;br /&gt;
; For your own context&lt;br /&gt;
: Home &amp;gt; Your Name &amp;gt; Page you are on. Clicking on &#039;Your Name&#039; will lead you to &#039;My home&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader.png|frame|none|alt=The header when viewing your context.|The header when your context.]]&lt;br /&gt;
&lt;br /&gt;
; For other users&#039; context&lt;br /&gt;
: Home &amp;gt; Users &amp;gt; User Name &amp;gt; Page you are on. Clicking on &#039;User Name&#039; will lead you to their profile.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader2.png|frame|none|alt=The header when viewing someone else&#039;s context.|The header when viewing someone else&#039;s context.]]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The user header contains very simplistic information about the user, and a few links to very common actions in regard to other users. For instance it can implement a link to send a message to the user, because you might want to be able to do that regardless of what user context page you are visiting. But, &#039;Edit profile&#039; should not be in it, because it is only relevant to the profile. It is very important to keep the number of available actions to a minimum, because having too many options would defeat the purpose of the simplicity and efficiency it is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== A user menu ===&lt;br /&gt;
&lt;br /&gt;
The new user menu would be a new renderer, called from the layout files as it was the case for the login info renderer. The content of the user menu is fixed and not configurable, however it is possible to override the renderer from a theme to change its layout and content.&lt;br /&gt;
&lt;br /&gt;
==== Design ====&lt;br /&gt;
&lt;br /&gt;
Placed on the top right of the site, the name of the user is displayed next to a user icon. The dropdown is displayed when the user clicks the icon or the name. On smaller screens only a user icon is displayed, and expands to reveal its content. When expanded the name of the user logged in is displayed.&lt;br /&gt;
&lt;br /&gt;
When the user is not logged in, a login link is displayed, regardless of the screen size.&lt;br /&gt;
&lt;br /&gt;
==== My grades ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My grades&#039; page will display the overall grades of the student in all their visible courses. The ordering can be changed, but the default would be alphabetical.&lt;br /&gt;
&lt;br /&gt;
==== Login as ====&lt;br /&gt;
&lt;br /&gt;
When logged in as someone else, the &#039;Logout&#039; entry becomes &#039;Return to Admin User&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Switch role ====&lt;br /&gt;
&lt;br /&gt;
When the user role is switched, the &#039;Logout&#039; entry becomes &#039;Return to my normal role&#039;. And the name of the user is appended with the role they switch to, e.g. &#039;Admin User (teacher)&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Trimming navigation ====&lt;br /&gt;
&lt;br /&gt;
At this stage we could trim the navigation block, but we decide not to remove anything just yet as it would create more confusion: some nodes would accessible from the user menu, and others from the navigation block.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
For it to be used, the user menu needs to be as short as possible and not being cluttered with additional links. It should contain what has been decided upon above, and not be changed - as users will acclimatise to it, adding and removing nodes should not be looked upon lightly. In any case, it should not contain more than 6 links, and should always contain:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* Preferences&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
These are very important to the user as they target user context-specific pages and nothing related to the site structure or the course. A link to &#039;My courses&#039; would be redundant as this information should be covered in the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
=== A user preferences page ===&lt;br /&gt;
&lt;br /&gt;
The preferences page is a list of links to sub-preferences page. The page will be generated from the navigation node &#039;My profile settings&#039;, though we will have to re-organise them so that each link belongs to a parent node. A link to the preferences page is added to the user menu.&lt;br /&gt;
&lt;br /&gt;
==== Re-organisation ====&lt;br /&gt;
&lt;br /&gt;
* User account&lt;br /&gt;
** Edit profile&lt;br /&gt;
** Account settings&lt;br /&gt;
** Change password&lt;br /&gt;
** Security keys&lt;br /&gt;
** Messaging&lt;br /&gt;
&lt;br /&gt;
* Blogs&lt;br /&gt;
** Preferences&lt;br /&gt;
** External blogs&lt;br /&gt;
** Register an external blog&lt;br /&gt;
&lt;br /&gt;
* Badges&lt;br /&gt;
** Manage my badges&lt;br /&gt;
** Preferences&lt;br /&gt;
** Backpack settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preferences page displays headings (the setting nodes) under which the links to the sub-pages will be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
The nodes &#039;Roles&#039; and &#039;Activity reports&#039; will not be part of this page, because they are context based: they point to the course or site context depending on the page we are on. They will remain in the navigation block, but only when the user has the capability to view them. When the only node in the &#039;My profile settings&#039; node is &#039;Preferences&#039;, then &#039;My profile settings&#039; is not displayed. Here is an example when you have the capability to view the reports and roles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblockpref.png|frame|none|alt=My profile settings node with extended capability.|My profile settings node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My profile settings&#039; node becomes the name of the user: &#039;Frédéric Massart&#039;. The &#039;Profile settings for Jetha Chan&#039; becomes &#039;Jetha Chan&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breadcrumb ====&lt;br /&gt;
&lt;br /&gt;
Each of the sub-pages should be checked to ensure that they are in the right hierarchy, the breadcrumb always looks like &#039;(User context nav) &amp;gt; Preferences &amp;gt; Preference heading &amp;gt; Page I am on&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Another user&#039;s preferences ====&lt;br /&gt;
&lt;br /&gt;
The node &#039;Profile settings for User B&#039; can be used to edit someone&#039;s settings. The content is similar to &#039;My profile settings&#039;, except that the node will always be displayed regardless of the presence of &#039;Roles&#039; or &#039;Activity reports&#039;. Currently there is no other way for a user with elevated privileges to access someone&#039;s preferences, but sooner or later the preferences will be accessible from their profiles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblocksomeonelse.png|frame|none|alt=Profile settings for X with extended capability.|Profile settings for X node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Repositories ====&lt;br /&gt;
&lt;br /&gt;
At present, repositories are configurable from the Navigation block - this is a good opportunity to move them to the &#039;Preferences&#039; page.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
Every link in this page should belong to a section, the sections are only headers that help the users finding what they are looking for. A plugin that adds user preferences related to its features should define a new heading and add its links to that heading. The heading is never clickable.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
For now we will only be focussing on the site profile of the user. Later on, we will be solving the problems linked to the course context, for instances the links to &#039;Blog&#039; or &#039;Forum interactions&#039; automatically filtered to only display the blog posts in the course.&lt;br /&gt;
&lt;br /&gt;
==== Content ====&lt;br /&gt;
&lt;br /&gt;
The contact details will be displayed in such a way that they do not look like a list any more. For instance, everyone knows what an email address is, there is no need to prefix it with &#039;Email address:&#039;.&lt;br /&gt;
&lt;br /&gt;
The badges will be displayed on the profile too.&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&lt;br /&gt;
* Edit profile (If this is your profile)&lt;br /&gt;
* Blog&lt;br /&gt;
* Forum interactions&lt;br /&gt;
* Notes (If you have the capability to)&lt;br /&gt;
* Preferences (If you have the capability to and are viewing someone&#039;s profile)&lt;br /&gt;
* Send a message&lt;br /&gt;
* Login as (If you have the capability to)&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can start trimming the node &#039;My profile&#039; a bit, but some nodes will remain until we sort out the &#039;My&#039; page. When doing so, it is important to make sure that the nodes &#039;Home &amp;gt; Some course &amp;gt; Participants &amp;gt; User B&#039; still contain everything it does right now, because those links point to course-based pages, and would not be accessible otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The profile page contains everything about the user that is public. In other words, a content specific to the user should not be displayed on the profile at all, because it would never be accessible to another user, e.g. &#039;Private files&#039;.&lt;br /&gt;
&lt;br /&gt;
There are exceptions to this rule, badges for example. As a setting allows you to define whether or not your badges are on your profile, you might not be able to see them there, so they should be available on your dashboard.&lt;br /&gt;
&lt;br /&gt;
For content controlled by permissions (and not preferences), they should remain on the profile. Take &#039;Blog&#039; as an example, an administrator can prevent blog entries from another user to be accessed depending on your role. As the user does not have any information about the roles of the other users, the blog link is displayed on the profile, but other users will not see it. Having a blog block on the &#039;My home&#039; page would not be useful because it simply duplicates the access points, for no apparent reason to the user.&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
We need to add more default blocks to the existing page, the different available blocks will be:&lt;br /&gt;
&lt;br /&gt;
* My courses (already there)&lt;br /&gt;
* My private files (already there)&lt;br /&gt;
* The calendar&lt;br /&gt;
* Upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
We need to add a link to &#039;My latest badges&#039; to the page listing all the badges.&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can now remove &#039;My profile&#039; (or now called &#039;Jetha Chan&#039;) from the navigation block entirely. But it has to still be accessible under the node of a user in a course tree.&lt;br /&gt;
&lt;br /&gt;
The node &#039;My courses&#039; is also removed, users should be used to using their dashboard to access their courses.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My home&#039; page contains everything about a user that is private and not accessible to other users. For instance, your calendar events or your private files. The list of courses you are enrolled in are an exception, they could be displayed on the user profile, but because they are so important and need to be layed out in useful fashion, they will be part of the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
This page does not need to link to pages which are already accessible from the &#039;User menu&#039;, for instance the profile.&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pending&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Accessing course grades for students&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
** Checking for inconsistencies in the breadcrumb jumping from one place to another.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
# The user menu&lt;br /&gt;
# Implementing the user &#039;header&#039; for user context pages&lt;br /&gt;
# The preferences page&lt;br /&gt;
# The new profile page&lt;br /&gt;
# Revisiting &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;To be defined.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.google.com/document/d/16BJsINun13StUFOQaejj3Gawz9jk22ir_r49f3MbInM/edit#heading=h.fuvsbkikzj88 Navigation experiment]&lt;br /&gt;
* [https://docs.google.com/document/d/1AXJw8uX6MczA5VC3phkVVv1ee5eZ2nluIiPC2ecgHLE/edit#heading=h.k3lh9alzq3iy Navigation prototyping 2.7]&lt;br /&gt;
* MDL-34838: Navigation inconsistencies&lt;br /&gt;
* [http://demo2k12.moodlerooms.com Minimal by Moodlerooms]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226791 Users’ personalised profiles]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45075</id>
		<title>Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45075"/>
		<updated>2014-05-30T09:26:07Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* Alternative site and course navigation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Renderer consistency&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = https://tracker.moodle.org/browse/MDL-45774&lt;br /&gt;
|discussion = -&lt;br /&gt;
|assignee = Frédéric Massart, Jetha Chan&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
Navigation throughout Moodle is often confusing and needs some improvement. With this in mind, a specification has been prepared, defining what problems were identified and how they will be solved. Particular focus will be placed upon improving the experience of students, teachers, and users unfamiliar to Moodle.&lt;br /&gt;
&lt;br /&gt;
== What can be improved ==&lt;br /&gt;
&lt;br /&gt;
Common complaints leveled at Moodle include:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unnecessary steep learning curve&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Features or options not being discovered&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;General frustration&#039;&#039;&#039; - clunkiness, a certain &#039;&#039;je ne sais quoi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The navigation is not static ===&lt;br /&gt;
&lt;br /&gt;
Sometimes when navigating from one place to another, the state of the tree in the navigation block completely changes. A good example of this is when going from a course to a module - upon arrival in a module, the Administration block will display a collapsed &#039;Course administration&#039; node and a new expanded &#039;Module administration&#039; node, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
[[File:pbnotstatic.png|frame|none|alt=Going from course to a module.|Going from course to a module.]]&lt;br /&gt;
&lt;br /&gt;
Consistency should be improved here, as it is unlikely that a user unfamiliar with the system will understand sudden collapsing of or additional nodes.&lt;br /&gt;
&lt;br /&gt;
=== Feature placement ===&lt;br /&gt;
&lt;br /&gt;
It is our opinion that some navigation nodes contain things that you wouldn&#039;t expect, and don&#039;t contain things that you &#039;&#039;&#039;would&#039;&#039; expect. For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;My profile settings&#039; contains &#039;Blogs&#039;, &#039;Badges&#039; or &#039;Messaging&#039;. These are not strictly related to your profile, they are related to your user account.&lt;br /&gt;
* What can be found under &#039;Site pages&#039;?&lt;br /&gt;
* Notes&lt;br /&gt;
** In order to view Notes taken on a course level, I first need to click on &#039;Participants&#039;, and once the page is loaded I can see new entries in the navigation node &#039;Participants&#039;. Why is this the case? Most users will not be aware of those links and will miss out on that feature, we feel.&lt;br /&gt;
&lt;br /&gt;
=== Bad naming ===&lt;br /&gt;
&lt;br /&gt;
Proper naming of the navigation helps the user remembering where to find what they are looking for. It also helps them to discover features that they would not otherwise be aware of, e.g. &#039;Calendar&#039;, hidden under &#039;Site pages&#039;. If a user has no understanding of what &#039;Site pages&#039; is, it is unlikely that they will expand it.&lt;br /&gt;
&lt;br /&gt;
Another popular(?) example of bad naming is the link &#039;My grades&#039; under &#039;Course administration&#039; in the &#039;Administration&#039; block. &#039;A student is not administrating anything, his grades are not a setting.&#039;&lt;br /&gt;
&lt;br /&gt;
=== Context jumps ===&lt;br /&gt;
&lt;br /&gt;
The breadcrumb and navigation sometimes jump from one context to another. For instance, as a student when you click on &#039;Administration &amp;gt; Course administration &amp;gt; My grades&#039;, the navigation node on which you appear to be after clicking is &#039;Administration &amp;gt; Grade administration &amp;gt; User report&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps.png|frame|none|alt=Breadcrumb context jumping.|Breadcrumb context jumping.]]&lt;br /&gt;
&lt;br /&gt;
It is also possible for the user to jump from a course context to a site context, leaving the course (different breadcrumb, different navigation) without realising it and instantly feeling lost. A common reaction would be to use the &#039;Back&#039; button of their browser to recover from it rather than trying to understand what happened. This behaviour can be observed when visiting someone&#039;s profile, viewing some reports, etc...&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps2.png|frame|none|alt=Navigation context jumping.|Navigation context jumping.]]&lt;br /&gt;
&lt;br /&gt;
In order for users to feel comfortable and confident, and to not feel lost in Moodle&#039;s complex page hierarchy, we need to prevent situations where they feel lost and frustrated.&lt;br /&gt;
&lt;br /&gt;
=== Overwhelming the user ===&lt;br /&gt;
&lt;br /&gt;
Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;.  We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&lt;br /&gt;
&lt;br /&gt;
== The goal ==&lt;br /&gt;
&lt;br /&gt;
We seek to provide navigation that is:&lt;br /&gt;
&lt;br /&gt;
* Simpler&lt;br /&gt;
* Intuitive&lt;br /&gt;
* Easy to learn&lt;br /&gt;
&lt;br /&gt;
Leading to myriad benefits, including but not limited to:&lt;br /&gt;
&lt;br /&gt;
; Efficiency&lt;br /&gt;
: Less trial and error when looking for something&lt;br /&gt;
; Common expectations being met&lt;br /&gt;
: Pages being found where you expect them to be&lt;br /&gt;
; A reduction in confusion and general frustration&lt;br /&gt;
; Less resistance&lt;br /&gt;
: New users feeling more confident using the product&lt;br /&gt;
&lt;br /&gt;
Some risk does present itself; by changing large sections of the product, we risk alienating existing experienced Moodle users, frustrated at not finding pages where they used to be. On the other hand, re-learning the navigation should be straightforward, painless and at the very least easier than learning it the first time. User documentation will also suffer in the interim, as screenshots, navigation patterns and other training materials will have to be updated.&lt;br /&gt;
&lt;br /&gt;
== Rough ideas ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of ideas gathered from discussions and resources both internal and external to HQ:&lt;br /&gt;
&lt;br /&gt;
* A student should be able to quickly access his courses, grades, settings, profile from a static place in the UI. This would remove the need for them to expand nodes in both the &#039;Navigation&#039; block and the &#039;Administration&#039; block.&lt;br /&gt;
* The different nodes of the &#039;Administration&#039; block could be displayed on a &#039;Preferences&#039; page.&lt;br /&gt;
** e.g. the &#039;Course administration&#039; items could be listed on a page, each node being a title and each of its elements listed underneath. By moving administration settings to a single page, we obviate the need for the &#039;Administration&#039; block entirely.&lt;br /&gt;
* A teacher should be able to quickly access the &#039;Options&#039; of a course through a static node, the same way a user can access anything associated to his account.&lt;br /&gt;
* Similarly for modules, an easy dropdown to access module preferences and more frequently used options could be created.&lt;br /&gt;
* Breadcrumb-based navigation to reduce and perhaps entirely remove the the need for the nested and cumbersome Navigation block.&lt;br /&gt;
** This could be problematic in regards to creating problems with accessing site pages, or pages which do not clearly have a hierarchical position.  This could be addressed by providing &#039;in context&#039; links. For instance, adding a new block entry should be available from the Blog page.&lt;br /&gt;
* Providing a sitemap page to counter the lack of &#039;Navigation&#039; block when something is not easily accessible.&lt;br /&gt;
* Ability to &#039;Star&#039; some pages to quickly access favourites.&lt;br /&gt;
* Develop a &#039;Smart search&#039; to easily access the content in the current course, other courses, etc… and the admin settings for admins.&lt;br /&gt;
* Populating my/ page with more useful content for the user itself.&lt;br /&gt;
* A new profile page on which is displayed the &#039;public&#039; information of the user. Their forum interactions, their blog, their reports, ...&lt;br /&gt;
* Providing an API to modules to implement their own navigation, thus not required to inject links in the navigation block like &#039;Chat&#039; is doing or &#039;Quiz&#039; used to do (Results report). This navigation would be displayed in a standard fashion across modules. (Tabs like in wiki?)&lt;br /&gt;
* When hovering a user&#039;s name, a menu could appear with a few details and links to their profile, etc... (like Jira does).&lt;br /&gt;
&lt;br /&gt;
== Analysis of popular themes ==&lt;br /&gt;
&lt;br /&gt;
Although most of those themes do not change anything about the navigation itself, a few have implemented a &#039;&#039;user menu&#039;&#039;. Usually displayed at the top most right of the screen, it contains links to quickly access user specific pages. The most common links are:&lt;br /&gt;
&lt;br /&gt;
* View profile&lt;br /&gt;
* Edit profile&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
Less popular links are:&lt;br /&gt;
&lt;br /&gt;
* Calendar&lt;br /&gt;
* My private files&lt;br /&gt;
* My home&lt;br /&gt;
&lt;br /&gt;
== The solutions ==&lt;br /&gt;
&lt;br /&gt;
To achieve our goal we have to remove the need for the administration and navigation blocks. This is a long process that needs to be broken down into sub-solutions. Some will need to be developed simultaneously to avoid half-baked temporary solutions. Those solutions can be split into two categories: &#039;User&#039;, and &#039;Course&#039;.&lt;br /&gt;
&lt;br /&gt;
User solutions:&lt;br /&gt;
&lt;br /&gt;
* A user menu&lt;br /&gt;
* A user preferences page&lt;br /&gt;
* A new profile page&lt;br /&gt;
* Revisiting &#039;My home&#039; page&lt;br /&gt;
&lt;br /&gt;
Course solutions:&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* A course &#039;Quick access&#039; menu&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
&lt;br /&gt;
The user menu is a dropdown containing links to pages specific to user. They are context independent and will always point to the same pages. The user menu can always be found at the same place in the user interface and will contain the following links:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* My grades&lt;br /&gt;
* Messages&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
[[File:usermenu.png|frame|none|alt=A user menu.|A user menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Gives quick and intuitive access to the user specific pages&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Emphasises the page &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== User preferences page ===&lt;br /&gt;
&lt;br /&gt;
A link to that page would be placed in the user menu. That page will contain most of what the user has control over on a site level. Their mailing preferences, changing their password, etc... but reorganised.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* We can remove &#039;My profile settings&#039; from the &#039;Administration&#039; block.&lt;br /&gt;
* The settings are all reachable from one place.&lt;br /&gt;
* New pages will help the user understanding what settings they have control over.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
By adding new content to the profile page, we can trim a bit more the navigation block. The profile page is supposed to contain anything you could find about a user, and there will be links to their blog, forum interactions, notes, to send them a message, etc...&lt;br /&gt;
&lt;br /&gt;
We will keep the distinction between the full profile and the course profiles, at this stage we only improve the site profile because the course profiles need more thoughts and are tied to the course solutions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Answering concerns of the &#039;User preferences page&#039;&lt;br /&gt;
* Bonus: the profile page has a reason to be visited&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
The My/ page is underused and does not contain enough valuable information for the users to visit it. We will update it to include more user-specific content. It will contain:&lt;br /&gt;
&lt;br /&gt;
* My courses&lt;br /&gt;
* My private files&lt;br /&gt;
* The calendar and upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
[[File:myhome.png|frame|none|alt=The new dashboard.|The new dashboard.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;, at this point it should be empty&lt;br /&gt;
* Making the my/ page more interesting and valuable&lt;br /&gt;
&lt;br /&gt;
=== Handling of course profiles ===&lt;br /&gt;
&lt;br /&gt;
We need to remove the confusion between site and course profiles, only a few more informations should be available when viewing a &#039;Course profile&#039;, but we do not need an entirely different profile for that purpose. The course specific information will be accessible from the user profile, but be in the context of the site profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No more course profile pages&lt;br /&gt;
&lt;br /&gt;
=== A course &#039;Quick access&#039; menu ===&lt;br /&gt;
&lt;br /&gt;
In order to remove the need for the nodes &#039;Participants&#039; and &#039;Badges&#039; from the &#039;Course&#039; entry in the &#039;Navigation block&#039;, and the &#039;Grades&#039; entry in the &#039;Course administration&#039; node (for students), we will implement a new &#039;Quick access&#039; menu for the course. This menu will be accessible on any page within a course, or module.&lt;br /&gt;
&lt;br /&gt;
This menu will only contain links to the 3 entries mentioned above. If later on we add more links to that list, the additional (and less important) entries will be displayed in a dropdown, or a in a &#039;More&#039; page.&lt;br /&gt;
&lt;br /&gt;
A new grades page will be created for students to access their course grades.&lt;br /&gt;
&lt;br /&gt;
It is important to keep the visible elements of this menu to a minimum. Not more than 3 elements should be displayed at a time. An exception can be made for users with more privileges who will see a &#039;Settings&#039; (or &#039;Administration&#039;) link, and perhaps a &#039;Reports&#039; one when we will work on them (see the following the other solutions below).&lt;br /&gt;
&lt;br /&gt;
To unenrol yourself from a course, you would not look into the &#039;Course administration&#039; node, you would rather find a link on &#039;My home&#039; page next to the list of courses to unenrol yourself from them.&lt;br /&gt;
&lt;br /&gt;
[[File:coursemenu.png|frame|none|alt=An example of a course quick-access menu.|An example of a course quick-access menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming the navigation block&lt;br /&gt;
* Removing the &#039;Course administration&#039; node for students&lt;br /&gt;
* Dedicated grades page for the students&lt;br /&gt;
* Quick access to the most important pages of a course&lt;br /&gt;
&lt;br /&gt;
=== An administration page per module ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the module would list everything that was originally in the &#039;Module administration&#039; node, but reorganised to be more intuitive. A link to that page would be placed somewhere in the general UI.&lt;br /&gt;
&lt;br /&gt;
The modules abusing the &#039;Adminstration&#039; block to inject new pages into their module should be updated to provide a module navigation instead. It could be a list of links in the module page, or a module navigation such as tabs, this is probably tied to the solution &#039;Alternative site and course navigation&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the module administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* Removes the need for the &#039;Module administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
&lt;br /&gt;
=== An administration page for the course ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the course would list everything that was originally in the &#039;Course administration&#039; node, but reorganised to be more intuitive. A link to that page will be added to the course &#039;Quick access&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the course administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* No more &#039;Course administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
* Reports would be accessible from that page until &#039;Dedicated solution to access reports&#039; is implemented&lt;br /&gt;
&lt;br /&gt;
=== Dedicated solution to access reports ===&lt;br /&gt;
&lt;br /&gt;
Reports are the black sheep of the navigation, nobody agrees on where they should be and they are moved around every so often. Perhaps nobody agrees because they do not belong either in the navigation or the administration block.&lt;br /&gt;
&lt;br /&gt;
Currently they are accessed from the &#039;Administration&#039; block, and as we are moving the content of the block to administration pages, that is where they will end up. This is surely not better (perhaps even worse) than where they were before, so why not thinking once and for all where they should be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/!\ Solution needed!&lt;br /&gt;
&lt;br /&gt;
Idea: We could add a &#039;Report&#039; menu to the course &#039;Quick access&#039; menu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Standardised way to access reports&lt;br /&gt;
* A navigation that does not jump somewhere else when viewing a report&lt;br /&gt;
&lt;br /&gt;
=== Alternative site and course navigation ===&lt;br /&gt;
&lt;br /&gt;
Now that everything has been sorted out, we should now be able to remove the navigation block - but first we&#039;ll need to sort out how to navigate at both the site and course levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Site level&#039;&#039;&#039;&lt;br /&gt;
It is envisaged that the frontpage would just be an entry point, with the navigation node &#039;Site pages&#039; displayed in a block specific to those site pages. Upon leaving the context of the &#039;Site&#039;, you will be in a course; most users will not go back to the front page, except to find some information specific to their institution. To navigate between their courses, teachers and students could refer to their my/ page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, pages like &#039;Participants&#039;, &#039;Badges&#039; or &#039;Tags&#039; could be accessed from their context, for instance in a &#039;Online users&#039; block which would link to &#039;All participants&#039;. The same applies for &#039;Calendar&#039;, but is already the case because of its block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course level&#039;&#039;&#039;&lt;br /&gt;
The site-level concept should disappear as soon as you get in a course; the student or teacher would then focus 100% on the course they are browsing rather than being distracted by site elements. This behavior is currently exhibited by the base and standard themes in 2.6 and before.&lt;br /&gt;
&lt;br /&gt;
The course format will become responsible for most of the navigation in the course, allowing course formats to:&lt;br /&gt;
&lt;br /&gt;
* Inject block(s) to navigate between sections&lt;br /&gt;
* Inject block(s) to navigate between modules&lt;br /&gt;
* Inject block(s) that does/do both of the above (very similar to the course node in the navigation block)&lt;br /&gt;
* Inject links &#039;Go to next activity&#039;, &#039;Go back to course&#039;, ... into module views.&lt;br /&gt;
&lt;br /&gt;
The course format will also have control over the course &#039;Quick access&#039; menu, in which it could inject/remove items if they wanted to.&lt;br /&gt;
&lt;br /&gt;
The node &#039;Switch role&#039; will be removed from the administration block, necessitating a &#039;Switch role&#039; block to be added to the course to unlock that functionality. This block would only be displayed to users having the capabilities to switch role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Future of the Administration block&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, the administration block will not be displayed to any user, except those users possessing elevated privileges. Administrators, managers or course creators will still have access to the administration block but it will only contain the &#039;Site administration&#039; node.&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
All the pages on a user context will all have their own layout where the header includes the name of the user in a standardised way, along with some information and a link to message them, and their preferences if the logged in user has the capabilities to edit them. A renderer will be responsible for creating the header, and will use the user ID found from the context defined on that page.&lt;br /&gt;
&lt;br /&gt;
The navigation within the context pages will be:&lt;br /&gt;
&lt;br /&gt;
; For your own context&lt;br /&gt;
: Home &amp;gt; Your Name &amp;gt; Page you are on. Clicking on &#039;Your Name&#039; will lead you to &#039;My home&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader.png|frame|none|alt=The header when viewing your context.|The header when your context.]]&lt;br /&gt;
&lt;br /&gt;
; For other users&#039; context&lt;br /&gt;
: Home &amp;gt; Users &amp;gt; User Name &amp;gt; Page you are on. Clicking on &#039;User Name&#039; will lead you to their profile.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader2.png|frame|none|alt=The header when viewing someone else&#039;s context.|The header when viewing someone else&#039;s context.]]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The user header contains very simplistic information about the user, and a few links to very common actions in regard to other users. For instance it can implement a link to send a message to the user, because you might want to be able to do that regardless of what user context page you are visiting. But, &#039;Edit profile&#039; should not be in it, because it is only relevant to the profile. It is very important to keep the number of available actions to a minimum, because having too many options would defeat the purpose of the simplicity and efficiency it is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== A user menu ===&lt;br /&gt;
&lt;br /&gt;
The new user menu would be a new renderer, called from the layout files as it was the case for the login info renderer. The content of the user menu is fixed and not configurable, however it is possible to override the renderer from a theme to change its layout and content.&lt;br /&gt;
&lt;br /&gt;
==== Design ====&lt;br /&gt;
&lt;br /&gt;
Placed on the top right of the site, the name of the user is displayed next to a user icon. The dropdown is displayed when the user clicks the icon or the name. On smaller screens only a user icon is displayed, and expands to reveal its content. When expanded the name of the user logged in is displayed.&lt;br /&gt;
&lt;br /&gt;
When the user is not logged in, a login link is displayed, regardless of the screen size.&lt;br /&gt;
&lt;br /&gt;
==== My grades ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My grades&#039; page will display the overall grades of the student in all their visible courses. The ordering can be changed, but the default would be alphabetical.&lt;br /&gt;
&lt;br /&gt;
==== Login as ====&lt;br /&gt;
&lt;br /&gt;
When logged in as someone else, the &#039;Logout&#039; entry becomes &#039;Return to Admin User&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Switch role ====&lt;br /&gt;
&lt;br /&gt;
When the user role is switched, the &#039;Logout&#039; entry becomes &#039;Return to my normal role&#039;. And the name of the user is appended with the role they switch to, e.g. &#039;Admin User (teacher)&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Trimming navigation ====&lt;br /&gt;
&lt;br /&gt;
At this stage we could trim the navigation block, but we decide not to remove anything just yet as it would create more confusion: some nodes would accessible from the user menu, and others from the navigation block.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
For it to be used, the user menu needs to be as short as possible and not being cluttered with additional links. It should contain what has been decided upon above, and not be changed - as users will acclimatise to it, adding and removing nodes should not be looked upon lightly. In any case, it should not contain more than 6 links, and should always contain:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* Preferences&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
These are very important to the user as they target user context-specific pages and nothing related to the site structure or the course. A link to &#039;My courses&#039; would be redundant as this information should be covered in the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
=== A user preferences page ===&lt;br /&gt;
&lt;br /&gt;
The preferences page is a list of links to sub-preferences page. The page will be generated from the navigation node &#039;My profile settings&#039;, though we will have to re-organise them so that each link belongs to a parent node. A link to the preferences page is added to the user menu.&lt;br /&gt;
&lt;br /&gt;
==== Re-organisation ====&lt;br /&gt;
&lt;br /&gt;
* User account&lt;br /&gt;
** Edit profile&lt;br /&gt;
** Account settings&lt;br /&gt;
** Change password&lt;br /&gt;
** Security keys&lt;br /&gt;
** Messaging&lt;br /&gt;
&lt;br /&gt;
* Blogs&lt;br /&gt;
** Preferences&lt;br /&gt;
** External blogs&lt;br /&gt;
** Register an external blog&lt;br /&gt;
&lt;br /&gt;
* Badges&lt;br /&gt;
** Manage my badges&lt;br /&gt;
** Preferences&lt;br /&gt;
** Backpack settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preferences page displays headings (the setting nodes) under which the links to the sub-pages will be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
The nodes &#039;Roles&#039; and &#039;Activity reports&#039; will not be part of this page, because they are context based: they point to the course or site context depending on the page we are on. They will remain in the navigation block, but only when the user has the capability to view them. When the only node in the &#039;My profile settings&#039; node is &#039;Preferences&#039;, then &#039;My profile settings&#039; is not displayed. Here is an example when you have the capability to view the reports and roles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblockpref.png|frame|none|alt=My profile settings node with extended capability.|My profile settings node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My profile settings&#039; node becomes the name of the user: &#039;Frédéric Massart&#039;. The &#039;Profile settings for Jetha Chan&#039; becomes &#039;Jetha Chan&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breadcrumb ====&lt;br /&gt;
&lt;br /&gt;
Each of the sub-pages should be checked to ensure that they are in the right hierarchy, the breadcrumb always looks like &#039;(User context nav) &amp;gt; Preferences &amp;gt; Preference heading &amp;gt; Page I am on&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Another user&#039;s preferences ====&lt;br /&gt;
&lt;br /&gt;
The node &#039;Profile settings for User B&#039; can be used to edit someone&#039;s settings. The content is similar to &#039;My profile settings&#039;, except that the node will always be displayed regardless of the presence of &#039;Roles&#039; or &#039;Activity reports&#039;. Currently there is no other way for a user with elevated privileges to access someone&#039;s preferences, but sooner or later the preferences will be accessible from their profiles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblocksomeonelse.png|frame|none|alt=Profile settings for X with extended capability.|Profile settings for X node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Repositories ====&lt;br /&gt;
&lt;br /&gt;
At present, repositories are configurable from the Navigation block - this is a good opportunity to move them to the &#039;Preferences&#039; page.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
Every link in this page should belong to a section, the sections are only headers that help the users finding what they are looking for. A plugin that adds user preferences related to its features should define a new heading and add its links to that heading. The heading is never clickable.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
For now we will only be focussing on the site profile of the user. Later on, we will be solving the problems linked to the course context, for instances the links to &#039;Blog&#039; or &#039;Forum interactions&#039; automatically filtered to only display the blog posts in the course.&lt;br /&gt;
&lt;br /&gt;
==== Content ====&lt;br /&gt;
&lt;br /&gt;
The contact details will be displayed in such a way that they do not look like a list any more. For instance, everyone knows what an email address is, there is no need to prefix it with &#039;Email address:&#039;.&lt;br /&gt;
&lt;br /&gt;
The badges will be displayed on the profile too.&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&lt;br /&gt;
* Edit profile (If this is your profile)&lt;br /&gt;
* Blog&lt;br /&gt;
* Forum interactions&lt;br /&gt;
* Notes (If you have the capability to)&lt;br /&gt;
* Preferences (If you have the capability to and are viewing someone&#039;s profile)&lt;br /&gt;
* Send a message&lt;br /&gt;
* Login as (If you have the capability to)&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can start trimming the node &#039;My profile&#039; a bit, but some nodes will remain until we sort out the &#039;My&#039; page. When doing so, it is important to make sure that the nodes &#039;Home &amp;gt; Some course &amp;gt; Participants &amp;gt; User B&#039; still contain everything it does right now, because those links point to course-based pages, and would not be accessible otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The profile page contains everything about the user that is public. In other words, a content specific to the user should not be displayed on the profile at all, because it would never be accessible to another user, e.g. &#039;Private files&#039;.&lt;br /&gt;
&lt;br /&gt;
There are exceptions to this rule, badges for example. As a setting allows you to define whether or not your badges are on your profile, you might not be able to see them there, so they should be available on your dashboard.&lt;br /&gt;
&lt;br /&gt;
For content controlled by permissions (and not preferences), they should remain on the profile. Take &#039;Blog&#039; as an example, an administrator can prevent blog entries from another user to be accessed depending on your role. As the user does not have any information about the roles of the other users, the blog link is displayed on the profile, but other users will not see it. Having a blog block on the &#039;My home&#039; page would not be useful because it simply duplicates the access points, for no apparent reason to the user.&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
We need to add more default blocks to the existing page, the different available blocks will be:&lt;br /&gt;
&lt;br /&gt;
* My courses (already there)&lt;br /&gt;
* My private files (already there)&lt;br /&gt;
* The calendar&lt;br /&gt;
* Upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
We need to add a link to &#039;My latest badges&#039; to the page listing all the badges.&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can now remove &#039;My profile&#039; (or now called &#039;Jetha Chan&#039;) from the navigation block entirely. But it has to still be accessible under the node of a user in a course tree.&lt;br /&gt;
&lt;br /&gt;
The node &#039;My courses&#039; is also removed, users should be used to using their dashboard to access their courses.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My home&#039; page contains everything about a user that is private and not accessible to other users. For instance, your calendar events or your private files. The list of courses you are enrolled in are an exception, they could be displayed on the user profile, but because they are so important and need to be layed out in useful fashion, they will be part of the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
This page does not need to link to pages which are already accessible from the &#039;User menu&#039;, for instance the profile.&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pending&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Accessing course grades for students&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
** Checking for inconsistencies in the breadcrumb jumping from one place to another.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
# The user menu&lt;br /&gt;
# Implementing the user &#039;header&#039; for user context pages&lt;br /&gt;
# The preferences page&lt;br /&gt;
# The new profile page&lt;br /&gt;
# Revisiting &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;To be defined.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.google.com/document/d/16BJsINun13StUFOQaejj3Gawz9jk22ir_r49f3MbInM/edit#heading=h.fuvsbkikzj88 Navigation experiment]&lt;br /&gt;
* [https://docs.google.com/document/d/1AXJw8uX6MczA5VC3phkVVv1ee5eZ2nluIiPC2ecgHLE/edit#heading=h.k3lh9alzq3iy Navigation prototyping 2.7]&lt;br /&gt;
* MDL-34838: Navigation inconsistencies&lt;br /&gt;
* [http://demo2k12.moodlerooms.com Minimal by Moodlerooms]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226791 Users’ personalised profiles]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45074</id>
		<title>Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45074"/>
		<updated>2014-05-30T09:17:38Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* Rules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Renderer consistency&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = https://tracker.moodle.org/browse/MDL-45774&lt;br /&gt;
|discussion = -&lt;br /&gt;
|assignee = Frédéric Massart, Jetha Chan&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
Navigation throughout Moodle is often confusing and needs some improvement. With this in mind, a specification has been prepared, defining what problems were identified and how they will be solved. Particular focus will be placed upon improving the experience of students, teachers, and users unfamiliar to Moodle.&lt;br /&gt;
&lt;br /&gt;
== What can be improved ==&lt;br /&gt;
&lt;br /&gt;
Common complaints leveled at Moodle include:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unnecessary steep learning curve&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Features or options not being discovered&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;General frustration&#039;&#039;&#039; - clunkiness, a certain &#039;&#039;je ne sais quoi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The navigation is not static ===&lt;br /&gt;
&lt;br /&gt;
Sometimes when navigating from one place to another, the state of the tree in the navigation block completely changes. A good example of this is when going from a course to a module - upon arrival in a module, the Administration block will display a collapsed &#039;Course administration&#039; node and a new expanded &#039;Module administration&#039; node, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
[[File:pbnotstatic.png|frame|none|alt=Going from course to a module.|Going from course to a module.]]&lt;br /&gt;
&lt;br /&gt;
Consistency should be improved here, as it is unlikely that a user unfamiliar with the system will understand sudden collapsing of or additional nodes.&lt;br /&gt;
&lt;br /&gt;
=== Feature placement ===&lt;br /&gt;
&lt;br /&gt;
It is our opinion that some navigation nodes contain things that you wouldn&#039;t expect, and don&#039;t contain things that you &#039;&#039;&#039;would&#039;&#039; expect. For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;My profile settings&#039; contains &#039;Blogs&#039;, &#039;Badges&#039; or &#039;Messaging&#039;. These are not strictly related to your profile, they are related to your user account.&lt;br /&gt;
* What can be found under &#039;Site pages&#039;?&lt;br /&gt;
* Notes&lt;br /&gt;
** In order to view Notes taken on a course level, I first need to click on &#039;Participants&#039;, and once the page is loaded I can see new entries in the navigation node &#039;Participants&#039;. Why is this the case? Most users will not be aware of those links and will miss out on that feature, we feel.&lt;br /&gt;
&lt;br /&gt;
=== Bad naming ===&lt;br /&gt;
&lt;br /&gt;
Proper naming of the navigation helps the user remembering where to find what they are looking for. It also helps them to discover features that they would not otherwise be aware of, e.g. &#039;Calendar&#039;, hidden under &#039;Site pages&#039;. If a user has no understanding of what &#039;Site pages&#039; is, it is unlikely that they will expand it.&lt;br /&gt;
&lt;br /&gt;
Another popular(?) example of bad naming is the link &#039;My grades&#039; under &#039;Course administration&#039; in the &#039;Administration&#039; block. &#039;A student is not administrating anything, his grades are not a setting.&#039;&lt;br /&gt;
&lt;br /&gt;
=== Context jumps ===&lt;br /&gt;
&lt;br /&gt;
The breadcrumb and navigation sometimes jump from one context to another. For instance, as a student when you click on &#039;Administration &amp;gt; Course administration &amp;gt; My grades&#039;, the navigation node on which you appear to be after clicking is &#039;Administration &amp;gt; Grade administration &amp;gt; User report&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps.png|frame|none|alt=Breadcrumb context jumping.|Breadcrumb context jumping.]]&lt;br /&gt;
&lt;br /&gt;
It is also possible for the user to jump from a course context to a site context, leaving the course (different breadcrumb, different navigation) without realising it and instantly feeling lost. A common reaction would be to use the &#039;Back&#039; button of their browser to recover from it rather than trying to understand what happened. This behaviour can be observed when visiting someone&#039;s profile, viewing some reports, etc...&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps2.png|frame|none|alt=Navigation context jumping.|Navigation context jumping.]]&lt;br /&gt;
&lt;br /&gt;
In order for users to feel comfortable and confident, and to not feel lost in Moodle&#039;s complex page hierarchy, we need to prevent situations where they feel lost and frustrated.&lt;br /&gt;
&lt;br /&gt;
=== Overwhelming the user ===&lt;br /&gt;
&lt;br /&gt;
Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;.  We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&lt;br /&gt;
&lt;br /&gt;
== The goal ==&lt;br /&gt;
&lt;br /&gt;
We seek to provide navigation that is:&lt;br /&gt;
&lt;br /&gt;
* Simpler&lt;br /&gt;
* Intuitive&lt;br /&gt;
* Easy to learn&lt;br /&gt;
&lt;br /&gt;
Leading to myriad benefits, including but not limited to:&lt;br /&gt;
&lt;br /&gt;
; Efficiency&lt;br /&gt;
: Less trial and error when looking for something&lt;br /&gt;
; Common expectations being met&lt;br /&gt;
: Pages being found where you expect them to be&lt;br /&gt;
; A reduction in confusion and general frustration&lt;br /&gt;
; Less resistance&lt;br /&gt;
: New users feeling more confident using the product&lt;br /&gt;
&lt;br /&gt;
Some risk does present itself; by changing large sections of the product, we risk alienating existing experienced Moodle users, frustrated at not finding pages where they used to be. On the other hand, re-learning the navigation should be straightforward, painless and at the very least easier than learning it the first time. User documentation will also suffer in the interim, as screenshots, navigation patterns and other training materials will have to be updated.&lt;br /&gt;
&lt;br /&gt;
== Rough ideas ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of ideas gathered from discussions and resources both internal and external to HQ:&lt;br /&gt;
&lt;br /&gt;
* A student should be able to quickly access his courses, grades, settings, profile from a static place in the UI. This would remove the need for them to expand nodes in both the &#039;Navigation&#039; block and the &#039;Administration&#039; block.&lt;br /&gt;
* The different nodes of the &#039;Administration&#039; block could be displayed on a &#039;Preferences&#039; page.&lt;br /&gt;
** e.g. the &#039;Course administration&#039; items could be listed on a page, each node being a title and each of its elements listed underneath. By moving administration settings to a single page, we obviate the need for the &#039;Administration&#039; block entirely.&lt;br /&gt;
* A teacher should be able to quickly access the &#039;Options&#039; of a course through a static node, the same way a user can access anything associated to his account.&lt;br /&gt;
* Similarly for modules, an easy dropdown to access module preferences and more frequently used options could be created.&lt;br /&gt;
* Breadcrumb-based navigation to reduce and perhaps entirely remove the the need for the nested and cumbersome Navigation block.&lt;br /&gt;
** This could be problematic in regards to creating problems with accessing site pages, or pages which do not clearly have a hierarchical position.  This could be addressed by providing &#039;in context&#039; links. For instance, adding a new block entry should be available from the Blog page.&lt;br /&gt;
* Providing a sitemap page to counter the lack of &#039;Navigation&#039; block when something is not easily accessible.&lt;br /&gt;
* Ability to &#039;Star&#039; some pages to quickly access favourites.&lt;br /&gt;
* Develop a &#039;Smart search&#039; to easily access the content in the current course, other courses, etc… and the admin settings for admins.&lt;br /&gt;
* Populating my/ page with more useful content for the user itself.&lt;br /&gt;
* A new profile page on which is displayed the &#039;public&#039; information of the user. Their forum interactions, their blog, their reports, ...&lt;br /&gt;
* Providing an API to modules to implement their own navigation, thus not required to inject links in the navigation block like &#039;Chat&#039; is doing or &#039;Quiz&#039; used to do (Results report). This navigation would be displayed in a standard fashion across modules. (Tabs like in wiki?)&lt;br /&gt;
* When hovering a user&#039;s name, a menu could appear with a few details and links to their profile, etc... (like Jira does).&lt;br /&gt;
&lt;br /&gt;
== Analysis of popular themes ==&lt;br /&gt;
&lt;br /&gt;
Although most of those themes do not change anything about the navigation itself, a few have implemented a &#039;&#039;user menu&#039;&#039;. Usually displayed at the top most right of the screen, it contains links to quickly access user specific pages. The most common links are:&lt;br /&gt;
&lt;br /&gt;
* View profile&lt;br /&gt;
* Edit profile&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
Less popular links are:&lt;br /&gt;
&lt;br /&gt;
* Calendar&lt;br /&gt;
* My private files&lt;br /&gt;
* My home&lt;br /&gt;
&lt;br /&gt;
== The solutions ==&lt;br /&gt;
&lt;br /&gt;
To achieve our goal we have to remove the need for the administration and navigation blocks. This is a long process that needs to be broken down into sub-solutions. Some will need to be developed simultaneously to avoid half-baked temporary solutions. Those solutions can be split into two categories: &#039;User&#039;, and &#039;Course&#039;.&lt;br /&gt;
&lt;br /&gt;
User solutions:&lt;br /&gt;
&lt;br /&gt;
* A user menu&lt;br /&gt;
* A user preferences page&lt;br /&gt;
* A new profile page&lt;br /&gt;
* Revisiting &#039;My home&#039; page&lt;br /&gt;
&lt;br /&gt;
Course solutions:&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* A course &#039;Quick access&#039; menu&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
&lt;br /&gt;
The user menu is a dropdown containing links to pages specific to user. They are context independent and will always point to the same pages. The user menu can always be found at the same place in the user interface and will contain the following links:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* My grades&lt;br /&gt;
* Messages&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
[[File:usermenu.png|frame|none|alt=A user menu.|A user menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Gives quick and intuitive access to the user specific pages&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Emphasises the page &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== User preferences page ===&lt;br /&gt;
&lt;br /&gt;
A link to that page would be placed in the user menu. That page will contain most of what the user has control over on a site level. Their mailing preferences, changing their password, etc... but reorganised.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* We can remove &#039;My profile settings&#039; from the &#039;Administration&#039; block.&lt;br /&gt;
* The settings are all reachable from one place.&lt;br /&gt;
* New pages will help the user understanding what settings they have control over.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
By adding new content to the profile page, we can trim a bit more the navigation block. The profile page is supposed to contain anything you could find about a user, and there will be links to their blog, forum interactions, notes, to send them a message, etc...&lt;br /&gt;
&lt;br /&gt;
We will keep the distinction between the full profile and the course profiles, at this stage we only improve the site profile because the course profiles need more thoughts and are tied to the course solutions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Answering concerns of the &#039;User preferences page&#039;&lt;br /&gt;
* Bonus: the profile page has a reason to be visited&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
The My/ page is underused and does not contain enough valuable information for the users to visit it. We will update it to include more user-specific content. It will contain:&lt;br /&gt;
&lt;br /&gt;
* My courses&lt;br /&gt;
* My private files&lt;br /&gt;
* The calendar and upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
[[File:myhome.png|frame|none|alt=The new dashboard.|The new dashboard.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;, at this point it should be empty&lt;br /&gt;
* Making the my/ page more interesting and valuable&lt;br /&gt;
&lt;br /&gt;
=== Handling of course profiles ===&lt;br /&gt;
&lt;br /&gt;
We need to remove the confusion between site and course profiles, only a few more informations should be available when viewing a &#039;Course profile&#039;, but we do not need an entirely different profile for that purpose. The course specific information will be accessible from the user profile, but be in the context of the site profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No more course profile pages&lt;br /&gt;
&lt;br /&gt;
=== A course &#039;Quick access&#039; menu ===&lt;br /&gt;
&lt;br /&gt;
In order to remove the need for the nodes &#039;Participants&#039; and &#039;Badges&#039; from the &#039;Course&#039; entry in the &#039;Navigation block&#039;, and the &#039;Grades&#039; entry in the &#039;Course administration&#039; node (for students), we will implement a new &#039;Quick access&#039; menu for the course. This menu will be accessible on any page within a course, or module.&lt;br /&gt;
&lt;br /&gt;
This menu will only contain links to the 3 entries mentioned above. If later on we add more links to that list, the additional (and less important) entries will be displayed in a dropdown, or a in a &#039;More&#039; page.&lt;br /&gt;
&lt;br /&gt;
A new grades page will be created for students to access their course grades.&lt;br /&gt;
&lt;br /&gt;
It is important to keep the visible elements of this menu to a minimum. Not more than 3 elements should be displayed at a time. An exception can be made for users with more privileges who will see a &#039;Settings&#039; (or &#039;Administration&#039;) link, and perhaps a &#039;Reports&#039; one when we will work on them (see the following the other solutions below).&lt;br /&gt;
&lt;br /&gt;
To unenrol yourself from a course, you would not look into the &#039;Course administration&#039; node, you would rather find a link on &#039;My home&#039; page next to the list of courses to unenrol yourself from them.&lt;br /&gt;
&lt;br /&gt;
[[File:coursemenu.png|frame|none|alt=An example of a course quick-access menu.|An example of a course quick-access menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming the navigation block&lt;br /&gt;
* Removing the &#039;Course administration&#039; node for students&lt;br /&gt;
* Dedicated grades page for the students&lt;br /&gt;
* Quick access to the most important pages of a course&lt;br /&gt;
&lt;br /&gt;
=== An administration page per module ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the module would list everything that was originally in the &#039;Module administration&#039; node, but reorganised to be more intuitive. A link to that page would be placed somewhere in the general UI.&lt;br /&gt;
&lt;br /&gt;
The modules abusing the &#039;Adminstration&#039; block to inject new pages into their module should be updated to provide a module navigation instead. It could be a list of links in the module page, or a module navigation such as tabs, this is probably tied to the solution &#039;Alternative site and course navigation&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the module administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* Removes the need for the &#039;Module administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
&lt;br /&gt;
=== An administration page for the course ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the course would list everything that was originally in the &#039;Course administration&#039; node, but reorganised to be more intuitive. A link to that page will be added to the course &#039;Quick access&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the course administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* No more &#039;Course administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
* Reports would be accessible from that page until &#039;Dedicated solution to access reports&#039; is implemented&lt;br /&gt;
&lt;br /&gt;
=== Dedicated solution to access reports ===&lt;br /&gt;
&lt;br /&gt;
Reports are the black sheep of the navigation, nobody agrees on where they should be and they are moved around every so often. Perhaps nobody agrees because they do not belong either in the navigation or the administration block.&lt;br /&gt;
&lt;br /&gt;
Currently they are accessed from the &#039;Administration&#039; block, and as we are moving the content of the block to administration pages, that is where they will end up. This is surely not better (perhaps even worse) than where they were before, so why not thinking once and for all where they should be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/!\ Solution needed!&lt;br /&gt;
&lt;br /&gt;
Idea: We could add a &#039;Report&#039; menu to the course &#039;Quick access&#039; menu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Standardised way to access reports&lt;br /&gt;
* A navigation that does not jump somewhere else when viewing a report&lt;br /&gt;
&lt;br /&gt;
=== Alternative site and course navigation ===&lt;br /&gt;
&lt;br /&gt;
Now, that everything else has been sorted out, we can will be able to remove the navigation block, but first we need to sort out how to navigate at the site and course levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Site level&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The frontpage would just be an entry point. The navigation node &#039;Site pages&#039; will be displayed in a block specific to the site pages. Once you leave the context of the &#039;Site&#039;, you will be in a course. Most users will not go back to the front page, except to find some information specific to their institution. To navigate between their courses, teachers and students would refer to their my/ page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, pages like &#039;Participants&#039;, &#039;Badges&#039; or &#039;Tags&#039; could be accessed from their context, for instance in a &#039;Online users&#039; block which would link to &#039;All participants&#039;. The same applies for &#039;Calendar&#039;, but is already the case because of the block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course level&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The concept of site would disappear as soon as you get in a course. A student or teacher would then focus 100% on the course they are browsing rather than being distracted by site elements.&lt;br /&gt;
&lt;br /&gt;
The course format will be responsible for most of the navigation in the course:&lt;br /&gt;
&lt;br /&gt;
* Injecting a block to navigate between sections&lt;br /&gt;
* Injecting a block to navigate between modules&lt;br /&gt;
* Injecting a block that does both of the above (very similar to the course node in the navigation block)&lt;br /&gt;
* Injecting links &#039;Go to next activity&#039;, &#039;Go back to course&#039;, ... into module views.&lt;br /&gt;
&lt;br /&gt;
The course format will also have control over the course &#039;Quick access&#039; menu, in which it could inject/remove items if they wanted to.&lt;br /&gt;
&lt;br /&gt;
The node &#039;Switch role&#039; disappears from the administration block and we now require a &#039;Switch role&#039; block to be added to the course to unlock that functionality. This block would only be displayed to users having the capabilities to switch role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Future of the Administration block&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, the administration block will not be displayed to any user, except the ones with elevated privileges. Administrators, managers or course creators will still have access to the administration block but it will only contain the &#039;Site administration&#039; node.&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
All the pages on a user context will all have their own layout where the header includes the name of the user in a standardised way, along with some information and a link to message them, and their preferences if the logged in user has the capabilities to edit them. A renderer will be responsible for creating the header, and will use the user ID found from the context defined on that page.&lt;br /&gt;
&lt;br /&gt;
The navigation within the context pages will be:&lt;br /&gt;
&lt;br /&gt;
; For your own context&lt;br /&gt;
: Home &amp;gt; Your Name &amp;gt; Page you are on. Clicking on &#039;Your Name&#039; will lead you to &#039;My home&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader.png|frame|none|alt=The header when viewing your context.|The header when your context.]]&lt;br /&gt;
&lt;br /&gt;
; For other users&#039; context&lt;br /&gt;
: Home &amp;gt; Users &amp;gt; User Name &amp;gt; Page you are on. Clicking on &#039;User Name&#039; will lead you to their profile.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader2.png|frame|none|alt=The header when viewing someone else&#039;s context.|The header when viewing someone else&#039;s context.]]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The user header contains very simplistic information about the user, and a few links to very common actions in regard to other users. For instance it can implement a link to send a message to the user, because you might want to be able to do that regardless of what user context page you are visiting. But, &#039;Edit profile&#039; should not be in it, because it is only relevant to the profile. It is very important to keep the number of available actions to a minimum, because having too many options would defeat the purpose of the simplicity and efficiency it is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== A user menu ===&lt;br /&gt;
&lt;br /&gt;
The new user menu would be a new renderer, called from the layout files as it was the case for the login info renderer. The content of the user menu is fixed and not configurable, however it is possible to override the renderer from a theme to change its layout and content.&lt;br /&gt;
&lt;br /&gt;
==== Design ====&lt;br /&gt;
&lt;br /&gt;
Placed on the top right of the site, the name of the user is displayed next to a user icon. The dropdown is displayed when the user clicks the icon or the name. On smaller screens only a user icon is displayed, and expands to reveal its content. When expanded the name of the user logged in is displayed.&lt;br /&gt;
&lt;br /&gt;
When the user is not logged in, a login link is displayed, regardless of the screen size.&lt;br /&gt;
&lt;br /&gt;
==== My grades ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My grades&#039; page will display the overall grades of the student in all their visible courses. The ordering can be changed, but the default would be alphabetical.&lt;br /&gt;
&lt;br /&gt;
==== Login as ====&lt;br /&gt;
&lt;br /&gt;
When logged in as someone else, the &#039;Logout&#039; entry becomes &#039;Return to Admin User&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Switch role ====&lt;br /&gt;
&lt;br /&gt;
When the user role is switched, the &#039;Logout&#039; entry becomes &#039;Return to my normal role&#039;. And the name of the user is appended with the role they switch to, e.g. &#039;Admin User (teacher)&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Trimming navigation ====&lt;br /&gt;
&lt;br /&gt;
At this stage we could trim the navigation block, but we decide not to remove anything just yet as it would create more confusion: some nodes would accessible from the user menu, and others from the navigation block.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
For it to be used, the user menu needs to be as short as possible and not being cluttered with additional links. It should contain what has been decided upon above, and not be changed - as users will acclimatise to it, adding and removing nodes should not be looked upon lightly. In any case, it should not contain more than 6 links, and should always contain:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* Preferences&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
These are very important to the user as they target user context-specific pages and nothing related to the site structure or the course. A link to &#039;My courses&#039; would be redundant as this information should be covered in the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
=== A user preferences page ===&lt;br /&gt;
&lt;br /&gt;
The preferences page is a list of links to sub-preferences page. The page will be generated from the navigation node &#039;My profile settings&#039;, though we will have to re-organise them so that each link belongs to a parent node. A link to the preferences page is added to the user menu.&lt;br /&gt;
&lt;br /&gt;
==== Re-organisation ====&lt;br /&gt;
&lt;br /&gt;
* User account&lt;br /&gt;
** Edit profile&lt;br /&gt;
** Account settings&lt;br /&gt;
** Change password&lt;br /&gt;
** Security keys&lt;br /&gt;
** Messaging&lt;br /&gt;
&lt;br /&gt;
* Blogs&lt;br /&gt;
** Preferences&lt;br /&gt;
** External blogs&lt;br /&gt;
** Register an external blog&lt;br /&gt;
&lt;br /&gt;
* Badges&lt;br /&gt;
** Manage my badges&lt;br /&gt;
** Preferences&lt;br /&gt;
** Backpack settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preferences page displays headings (the setting nodes) under which the links to the sub-pages will be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
The nodes &#039;Roles&#039; and &#039;Activity reports&#039; will not be part of this page, because they are context based: they point to the course or site context depending on the page we are on. They will remain in the navigation block, but only when the user has the capability to view them. When the only node in the &#039;My profile settings&#039; node is &#039;Preferences&#039;, then &#039;My profile settings&#039; is not displayed. Here is an example when you have the capability to view the reports and roles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblockpref.png|frame|none|alt=My profile settings node with extended capability.|My profile settings node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My profile settings&#039; node becomes the name of the user: &#039;Frédéric Massart&#039;. The &#039;Profile settings for Jetha Chan&#039; becomes &#039;Jetha Chan&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breadcrumb ====&lt;br /&gt;
&lt;br /&gt;
Each of the sub-pages should be checked to ensure that they are in the right hierarchy, the breadcrumb always looks like &#039;(User context nav) &amp;gt; Preferences &amp;gt; Preference heading &amp;gt; Page I am on&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Another user&#039;s preferences ====&lt;br /&gt;
&lt;br /&gt;
The node &#039;Profile settings for User B&#039; can be used to edit someone&#039;s settings. The content is similar to &#039;My profile settings&#039;, except that the node will always be displayed regardless of the presence of &#039;Roles&#039; or &#039;Activity reports&#039;. Currently there is no other way for a user with elevated privileges to access someone&#039;s preferences, but sooner or later the preferences will be accessible from their profiles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblocksomeonelse.png|frame|none|alt=Profile settings for X with extended capability.|Profile settings for X node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Repositories ====&lt;br /&gt;
&lt;br /&gt;
At present, repositories are configurable from the Navigation block - this is a good opportunity to move them to the &#039;Preferences&#039; page.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
Every link in this page should belong to a section, the sections are only headers that help the users finding what they are looking for. A plugin that adds user preferences related to its features should define a new heading and add its links to that heading. The heading is never clickable.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
For now we will only be focussing on the site profile of the user. Later on, we will be solving the problems linked to the course context, for instances the links to &#039;Blog&#039; or &#039;Forum interactions&#039; automatically filtered to only display the blog posts in the course.&lt;br /&gt;
&lt;br /&gt;
==== Content ====&lt;br /&gt;
&lt;br /&gt;
The contact details will be displayed in such a way that they do not look like a list any more. For instance, everyone knows what an email address is, there is no need to prefix it with &#039;Email address:&#039;.&lt;br /&gt;
&lt;br /&gt;
The badges will be displayed on the profile too.&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&lt;br /&gt;
* Edit profile (If this is your profile)&lt;br /&gt;
* Blog&lt;br /&gt;
* Forum interactions&lt;br /&gt;
* Notes (If you have the capability to)&lt;br /&gt;
* Preferences (If you have the capability to and are viewing someone&#039;s profile)&lt;br /&gt;
* Send a message&lt;br /&gt;
* Login as (If you have the capability to)&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can start trimming the node &#039;My profile&#039; a bit, but some nodes will remain until we sort out the &#039;My&#039; page. When doing so, it is important to make sure that the nodes &#039;Home &amp;gt; Some course &amp;gt; Participants &amp;gt; User B&#039; still contain everything it does right now, because those links point to course-based pages, and would not be accessible otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The profile page contains everything about the user that is public. In other words, a content specific to the user should not be displayed on the profile at all, because it would never be accessible to another user, e.g. &#039;Private files&#039;.&lt;br /&gt;
&lt;br /&gt;
There are exceptions to this rule, badges for example. As a setting allows you to define whether or not your badges are on your profile, you might not be able to see them there, so they should be available on your dashboard.&lt;br /&gt;
&lt;br /&gt;
For content controlled by permissions (and not preferences), they should remain on the profile. Take &#039;Blog&#039; as an example, an administrator can prevent blog entries from another user to be accessed depending on your role. As the user does not have any information about the roles of the other users, the blog link is displayed on the profile, but other users will not see it. Having a blog block on the &#039;My home&#039; page would not be useful because it simply duplicates the access points, for no apparent reason to the user.&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
We need to add more default blocks to the existing page, the different available blocks will be:&lt;br /&gt;
&lt;br /&gt;
* My courses (already there)&lt;br /&gt;
* My private files (already there)&lt;br /&gt;
* The calendar&lt;br /&gt;
* Upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
We need to add a link to &#039;My latest badges&#039; to the page listing all the badges.&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can now remove &#039;My profile&#039; (or now called &#039;Jetha Chan&#039;) from the navigation block entirely. But it has to still be accessible under the node of a user in a course tree.&lt;br /&gt;
&lt;br /&gt;
The node &#039;My courses&#039; is also removed, users should be used to using their dashboard to access their courses.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My home&#039; page contains everything about a user that is private and not accessible to other users. For instance, your calendar events or your private files. The list of courses you are enrolled in are an exception, they could be displayed on the user profile, but because they are so important and need to be layed out in useful fashion, they will be part of the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
This page does not need to link to pages which are already accessible from the &#039;User menu&#039;, for instance the profile.&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pending&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Accessing course grades for students&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
** Checking for inconsistencies in the breadcrumb jumping from one place to another.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
# The user menu&lt;br /&gt;
# Implementing the user &#039;header&#039; for user context pages&lt;br /&gt;
# The preferences page&lt;br /&gt;
# The new profile page&lt;br /&gt;
# Revisiting &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;To be defined.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.google.com/document/d/16BJsINun13StUFOQaejj3Gawz9jk22ir_r49f3MbInM/edit#heading=h.fuvsbkikzj88 Navigation experiment]&lt;br /&gt;
* [https://docs.google.com/document/d/1AXJw8uX6MczA5VC3phkVVv1ee5eZ2nluIiPC2ecgHLE/edit#heading=h.k3lh9alzq3iy Navigation prototyping 2.7]&lt;br /&gt;
* MDL-34838: Navigation inconsistencies&lt;br /&gt;
* [http://demo2k12.moodlerooms.com Minimal by Moodlerooms]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226791 Users’ personalised profiles]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45073</id>
		<title>Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45073"/>
		<updated>2014-05-30T09:14:39Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* Re-organisation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Renderer consistency&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = https://tracker.moodle.org/browse/MDL-45774&lt;br /&gt;
|discussion = -&lt;br /&gt;
|assignee = Frédéric Massart, Jetha Chan&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
Navigation throughout Moodle is often confusing and needs some improvement. With this in mind, a specification has been prepared, defining what problems were identified and how they will be solved. Particular focus will be placed upon improving the experience of students, teachers, and users unfamiliar to Moodle.&lt;br /&gt;
&lt;br /&gt;
== What can be improved ==&lt;br /&gt;
&lt;br /&gt;
Common complaints leveled at Moodle include:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unnecessary steep learning curve&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Features or options not being discovered&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;General frustration&#039;&#039;&#039; - clunkiness, a certain &#039;&#039;je ne sais quoi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The navigation is not static ===&lt;br /&gt;
&lt;br /&gt;
Sometimes when navigating from one place to another, the state of the tree in the navigation block completely changes. A good example of this is when going from a course to a module - upon arrival in a module, the Administration block will display a collapsed &#039;Course administration&#039; node and a new expanded &#039;Module administration&#039; node, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
[[File:pbnotstatic.png|frame|none|alt=Going from course to a module.|Going from course to a module.]]&lt;br /&gt;
&lt;br /&gt;
Consistency should be improved here, as it is unlikely that a user unfamiliar with the system will understand sudden collapsing of or additional nodes.&lt;br /&gt;
&lt;br /&gt;
=== Feature placement ===&lt;br /&gt;
&lt;br /&gt;
It is our opinion that some navigation nodes contain things that you wouldn&#039;t expect, and don&#039;t contain things that you &#039;&#039;&#039;would&#039;&#039; expect. For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;My profile settings&#039; contains &#039;Blogs&#039;, &#039;Badges&#039; or &#039;Messaging&#039;. These are not strictly related to your profile, they are related to your user account.&lt;br /&gt;
* What can be found under &#039;Site pages&#039;?&lt;br /&gt;
* Notes&lt;br /&gt;
** In order to view Notes taken on a course level, I first need to click on &#039;Participants&#039;, and once the page is loaded I can see new entries in the navigation node &#039;Participants&#039;. Why is this the case? Most users will not be aware of those links and will miss out on that feature, we feel.&lt;br /&gt;
&lt;br /&gt;
=== Bad naming ===&lt;br /&gt;
&lt;br /&gt;
Proper naming of the navigation helps the user remembering where to find what they are looking for. It also helps them to discover features that they would not otherwise be aware of, e.g. &#039;Calendar&#039;, hidden under &#039;Site pages&#039;. If a user has no understanding of what &#039;Site pages&#039; is, it is unlikely that they will expand it.&lt;br /&gt;
&lt;br /&gt;
Another popular(?) example of bad naming is the link &#039;My grades&#039; under &#039;Course administration&#039; in the &#039;Administration&#039; block. &#039;A student is not administrating anything, his grades are not a setting.&#039;&lt;br /&gt;
&lt;br /&gt;
=== Context jumps ===&lt;br /&gt;
&lt;br /&gt;
The breadcrumb and navigation sometimes jump from one context to another. For instance, as a student when you click on &#039;Administration &amp;gt; Course administration &amp;gt; My grades&#039;, the navigation node on which you appear to be after clicking is &#039;Administration &amp;gt; Grade administration &amp;gt; User report&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps.png|frame|none|alt=Breadcrumb context jumping.|Breadcrumb context jumping.]]&lt;br /&gt;
&lt;br /&gt;
It is also possible for the user to jump from a course context to a site context, leaving the course (different breadcrumb, different navigation) without realising it and instantly feeling lost. A common reaction would be to use the &#039;Back&#039; button of their browser to recover from it rather than trying to understand what happened. This behaviour can be observed when visiting someone&#039;s profile, viewing some reports, etc...&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps2.png|frame|none|alt=Navigation context jumping.|Navigation context jumping.]]&lt;br /&gt;
&lt;br /&gt;
In order for users to feel comfortable and confident, and to not feel lost in Moodle&#039;s complex page hierarchy, we need to prevent situations where they feel lost and frustrated.&lt;br /&gt;
&lt;br /&gt;
=== Overwhelming the user ===&lt;br /&gt;
&lt;br /&gt;
Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;.  We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&lt;br /&gt;
&lt;br /&gt;
== The goal ==&lt;br /&gt;
&lt;br /&gt;
We seek to provide navigation that is:&lt;br /&gt;
&lt;br /&gt;
* Simpler&lt;br /&gt;
* Intuitive&lt;br /&gt;
* Easy to learn&lt;br /&gt;
&lt;br /&gt;
Leading to myriad benefits, including but not limited to:&lt;br /&gt;
&lt;br /&gt;
; Efficiency&lt;br /&gt;
: Less trial and error when looking for something&lt;br /&gt;
; Common expectations being met&lt;br /&gt;
: Pages being found where you expect them to be&lt;br /&gt;
; A reduction in confusion and general frustration&lt;br /&gt;
; Less resistance&lt;br /&gt;
: New users feeling more confident using the product&lt;br /&gt;
&lt;br /&gt;
Some risk does present itself; by changing large sections of the product, we risk alienating existing experienced Moodle users, frustrated at not finding pages where they used to be. On the other hand, re-learning the navigation should be straightforward, painless and at the very least easier than learning it the first time. User documentation will also suffer in the interim, as screenshots, navigation patterns and other training materials will have to be updated.&lt;br /&gt;
&lt;br /&gt;
== Rough ideas ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of ideas gathered from discussions and resources both internal and external to HQ:&lt;br /&gt;
&lt;br /&gt;
* A student should be able to quickly access his courses, grades, settings, profile from a static place in the UI. This would remove the need for them to expand nodes in both the &#039;Navigation&#039; block and the &#039;Administration&#039; block.&lt;br /&gt;
* The different nodes of the &#039;Administration&#039; block could be displayed on a &#039;Preferences&#039; page.&lt;br /&gt;
** e.g. the &#039;Course administration&#039; items could be listed on a page, each node being a title and each of its elements listed underneath. By moving administration settings to a single page, we obviate the need for the &#039;Administration&#039; block entirely.&lt;br /&gt;
* A teacher should be able to quickly access the &#039;Options&#039; of a course through a static node, the same way a user can access anything associated to his account.&lt;br /&gt;
* Similarly for modules, an easy dropdown to access module preferences and more frequently used options could be created.&lt;br /&gt;
* Breadcrumb-based navigation to reduce and perhaps entirely remove the the need for the nested and cumbersome Navigation block.&lt;br /&gt;
** This could be problematic in regards to creating problems with accessing site pages, or pages which do not clearly have a hierarchical position.  This could be addressed by providing &#039;in context&#039; links. For instance, adding a new block entry should be available from the Blog page.&lt;br /&gt;
* Providing a sitemap page to counter the lack of &#039;Navigation&#039; block when something is not easily accessible.&lt;br /&gt;
* Ability to &#039;Star&#039; some pages to quickly access favourites.&lt;br /&gt;
* Develop a &#039;Smart search&#039; to easily access the content in the current course, other courses, etc… and the admin settings for admins.&lt;br /&gt;
* Populating my/ page with more useful content for the user itself.&lt;br /&gt;
* A new profile page on which is displayed the &#039;public&#039; information of the user. Their forum interactions, their blog, their reports, ...&lt;br /&gt;
* Providing an API to modules to implement their own navigation, thus not required to inject links in the navigation block like &#039;Chat&#039; is doing or &#039;Quiz&#039; used to do (Results report). This navigation would be displayed in a standard fashion across modules. (Tabs like in wiki?)&lt;br /&gt;
* When hovering a user&#039;s name, a menu could appear with a few details and links to their profile, etc... (like Jira does).&lt;br /&gt;
&lt;br /&gt;
== Analysis of popular themes ==&lt;br /&gt;
&lt;br /&gt;
Although most of those themes do not change anything about the navigation itself, a few have implemented a &#039;&#039;user menu&#039;&#039;. Usually displayed at the top most right of the screen, it contains links to quickly access user specific pages. The most common links are:&lt;br /&gt;
&lt;br /&gt;
* View profile&lt;br /&gt;
* Edit profile&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
Less popular links are:&lt;br /&gt;
&lt;br /&gt;
* Calendar&lt;br /&gt;
* My private files&lt;br /&gt;
* My home&lt;br /&gt;
&lt;br /&gt;
== The solutions ==&lt;br /&gt;
&lt;br /&gt;
To achieve our goal we have to remove the need for the administration and navigation blocks. This is a long process that needs to be broken down into sub-solutions. Some will need to be developed simultaneously to avoid half-baked temporary solutions. Those solutions can be split into two categories: &#039;User&#039;, and &#039;Course&#039;.&lt;br /&gt;
&lt;br /&gt;
User solutions:&lt;br /&gt;
&lt;br /&gt;
* A user menu&lt;br /&gt;
* A user preferences page&lt;br /&gt;
* A new profile page&lt;br /&gt;
* Revisiting &#039;My home&#039; page&lt;br /&gt;
&lt;br /&gt;
Course solutions:&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* A course &#039;Quick access&#039; menu&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
&lt;br /&gt;
The user menu is a dropdown containing links to pages specific to user. They are context independent and will always point to the same pages. The user menu can always be found at the same place in the user interface and will contain the following links:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* My grades&lt;br /&gt;
* Messages&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
[[File:usermenu.png|frame|none|alt=A user menu.|A user menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Gives quick and intuitive access to the user specific pages&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Emphasises the page &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== User preferences page ===&lt;br /&gt;
&lt;br /&gt;
A link to that page would be placed in the user menu. That page will contain most of what the user has control over on a site level. Their mailing preferences, changing their password, etc... but reorganised.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* We can remove &#039;My profile settings&#039; from the &#039;Administration&#039; block.&lt;br /&gt;
* The settings are all reachable from one place.&lt;br /&gt;
* New pages will help the user understanding what settings they have control over.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
By adding new content to the profile page, we can trim a bit more the navigation block. The profile page is supposed to contain anything you could find about a user, and there will be links to their blog, forum interactions, notes, to send them a message, etc...&lt;br /&gt;
&lt;br /&gt;
We will keep the distinction between the full profile and the course profiles, at this stage we only improve the site profile because the course profiles need more thoughts and are tied to the course solutions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Answering concerns of the &#039;User preferences page&#039;&lt;br /&gt;
* Bonus: the profile page has a reason to be visited&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
The My/ page is underused and does not contain enough valuable information for the users to visit it. We will update it to include more user-specific content. It will contain:&lt;br /&gt;
&lt;br /&gt;
* My courses&lt;br /&gt;
* My private files&lt;br /&gt;
* The calendar and upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
[[File:myhome.png|frame|none|alt=The new dashboard.|The new dashboard.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;, at this point it should be empty&lt;br /&gt;
* Making the my/ page more interesting and valuable&lt;br /&gt;
&lt;br /&gt;
=== Handling of course profiles ===&lt;br /&gt;
&lt;br /&gt;
We need to remove the confusion between site and course profiles, only a few more informations should be available when viewing a &#039;Course profile&#039;, but we do not need an entirely different profile for that purpose. The course specific information will be accessible from the user profile, but be in the context of the site profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No more course profile pages&lt;br /&gt;
&lt;br /&gt;
=== A course &#039;Quick access&#039; menu ===&lt;br /&gt;
&lt;br /&gt;
In order to remove the need for the nodes &#039;Participants&#039; and &#039;Badges&#039; from the &#039;Course&#039; entry in the &#039;Navigation block&#039;, and the &#039;Grades&#039; entry in the &#039;Course administration&#039; node (for students), we will implement a new &#039;Quick access&#039; menu for the course. This menu will be accessible on any page within a course, or module.&lt;br /&gt;
&lt;br /&gt;
This menu will only contain links to the 3 entries mentioned above. If later on we add more links to that list, the additional (and less important) entries will be displayed in a dropdown, or a in a &#039;More&#039; page.&lt;br /&gt;
&lt;br /&gt;
A new grades page will be created for students to access their course grades.&lt;br /&gt;
&lt;br /&gt;
It is important to keep the visible elements of this menu to a minimum. Not more than 3 elements should be displayed at a time. An exception can be made for users with more privileges who will see a &#039;Settings&#039; (or &#039;Administration&#039;) link, and perhaps a &#039;Reports&#039; one when we will work on them (see the following the other solutions below).&lt;br /&gt;
&lt;br /&gt;
To unenrol yourself from a course, you would not look into the &#039;Course administration&#039; node, you would rather find a link on &#039;My home&#039; page next to the list of courses to unenrol yourself from them.&lt;br /&gt;
&lt;br /&gt;
[[File:coursemenu.png|frame|none|alt=An example of a course quick-access menu.|An example of a course quick-access menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming the navigation block&lt;br /&gt;
* Removing the &#039;Course administration&#039; node for students&lt;br /&gt;
* Dedicated grades page for the students&lt;br /&gt;
* Quick access to the most important pages of a course&lt;br /&gt;
&lt;br /&gt;
=== An administration page per module ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the module would list everything that was originally in the &#039;Module administration&#039; node, but reorganised to be more intuitive. A link to that page would be placed somewhere in the general UI.&lt;br /&gt;
&lt;br /&gt;
The modules abusing the &#039;Adminstration&#039; block to inject new pages into their module should be updated to provide a module navigation instead. It could be a list of links in the module page, or a module navigation such as tabs, this is probably tied to the solution &#039;Alternative site and course navigation&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the module administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* Removes the need for the &#039;Module administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
&lt;br /&gt;
=== An administration page for the course ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the course would list everything that was originally in the &#039;Course administration&#039; node, but reorganised to be more intuitive. A link to that page will be added to the course &#039;Quick access&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the course administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* No more &#039;Course administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
* Reports would be accessible from that page until &#039;Dedicated solution to access reports&#039; is implemented&lt;br /&gt;
&lt;br /&gt;
=== Dedicated solution to access reports ===&lt;br /&gt;
&lt;br /&gt;
Reports are the black sheep of the navigation, nobody agrees on where they should be and they are moved around every so often. Perhaps nobody agrees because they do not belong either in the navigation or the administration block.&lt;br /&gt;
&lt;br /&gt;
Currently they are accessed from the &#039;Administration&#039; block, and as we are moving the content of the block to administration pages, that is where they will end up. This is surely not better (perhaps even worse) than where they were before, so why not thinking once and for all where they should be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/!\ Solution needed!&lt;br /&gt;
&lt;br /&gt;
Idea: We could add a &#039;Report&#039; menu to the course &#039;Quick access&#039; menu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Standardised way to access reports&lt;br /&gt;
* A navigation that does not jump somewhere else when viewing a report&lt;br /&gt;
&lt;br /&gt;
=== Alternative site and course navigation ===&lt;br /&gt;
&lt;br /&gt;
Now, that everything else has been sorted out, we can will be able to remove the navigation block, but first we need to sort out how to navigate at the site and course levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Site level&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The frontpage would just be an entry point. The navigation node &#039;Site pages&#039; will be displayed in a block specific to the site pages. Once you leave the context of the &#039;Site&#039;, you will be in a course. Most users will not go back to the front page, except to find some information specific to their institution. To navigate between their courses, teachers and students would refer to their my/ page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, pages like &#039;Participants&#039;, &#039;Badges&#039; or &#039;Tags&#039; could be accessed from their context, for instance in a &#039;Online users&#039; block which would link to &#039;All participants&#039;. The same applies for &#039;Calendar&#039;, but is already the case because of the block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course level&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The concept of site would disappear as soon as you get in a course. A student or teacher would then focus 100% on the course they are browsing rather than being distracted by site elements.&lt;br /&gt;
&lt;br /&gt;
The course format will be responsible for most of the navigation in the course:&lt;br /&gt;
&lt;br /&gt;
* Injecting a block to navigate between sections&lt;br /&gt;
* Injecting a block to navigate between modules&lt;br /&gt;
* Injecting a block that does both of the above (very similar to the course node in the navigation block)&lt;br /&gt;
* Injecting links &#039;Go to next activity&#039;, &#039;Go back to course&#039;, ... into module views.&lt;br /&gt;
&lt;br /&gt;
The course format will also have control over the course &#039;Quick access&#039; menu, in which it could inject/remove items if they wanted to.&lt;br /&gt;
&lt;br /&gt;
The node &#039;Switch role&#039; disappears from the administration block and we now require a &#039;Switch role&#039; block to be added to the course to unlock that functionality. This block would only be displayed to users having the capabilities to switch role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Future of the Administration block&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, the administration block will not be displayed to any user, except the ones with elevated privileges. Administrators, managers or course creators will still have access to the administration block but it will only contain the &#039;Site administration&#039; node.&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
All the pages on a user context will all have their own layout where the header includes the name of the user in a standardised way, along with some information and a link to message them, and their preferences if the logged in user has the capabilities to edit them. A renderer will be responsible for creating the header, and will use the user ID found from the context defined on that page.&lt;br /&gt;
&lt;br /&gt;
The navigation within the context pages will be:&lt;br /&gt;
&lt;br /&gt;
; For your own context&lt;br /&gt;
: Home &amp;gt; Your Name &amp;gt; Page you are on. Clicking on &#039;Your Name&#039; will lead you to &#039;My home&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader.png|frame|none|alt=The header when viewing your context.|The header when your context.]]&lt;br /&gt;
&lt;br /&gt;
; For other users&#039; context&lt;br /&gt;
: Home &amp;gt; Users &amp;gt; User Name &amp;gt; Page you are on. Clicking on &#039;User Name&#039; will lead you to their profile.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader2.png|frame|none|alt=The header when viewing someone else&#039;s context.|The header when viewing someone else&#039;s context.]]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The user header contains very simplistic information about the user, and a few links to very common actions in regard to other users. For instance it can implement a link to send a message to the user, because you might want to be able to do that regardless of what user context page you are visiting. But, &#039;Edit profile&#039; should not be in it, because it is only relevant to the profile. It is very important to keep the number of available actions to a minimum, because having too many options would defeat the purpose of the simplicity and efficiency it is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== A user menu ===&lt;br /&gt;
&lt;br /&gt;
The new user menu would be a new renderer, called from the layout files as it was the case for the login info renderer. The content of the user menu is fixed and not configurable, however it is possible to override the renderer from a theme to change its layout and content.&lt;br /&gt;
&lt;br /&gt;
==== Design ====&lt;br /&gt;
&lt;br /&gt;
Placed on the top right of the site, the name of the user is displayed next to a user icon. The dropdown is displayed when the user clicks the icon or the name. On smaller screens only a user icon is displayed, and expands to reveal its content. When expanded the name of the user logged in is displayed.&lt;br /&gt;
&lt;br /&gt;
When the user is not logged in, a login link is displayed, regardless of the screen size.&lt;br /&gt;
&lt;br /&gt;
==== My grades ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My grades&#039; page will display the overall grades of the student in all their visible courses. The ordering can be changed, but the default would be alphabetical.&lt;br /&gt;
&lt;br /&gt;
==== Login as ====&lt;br /&gt;
&lt;br /&gt;
When logged in as someone else, the &#039;Logout&#039; entry becomes &#039;Return to Admin User&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Switch role ====&lt;br /&gt;
&lt;br /&gt;
When the user role is switched, the &#039;Logout&#039; entry becomes &#039;Return to my normal role&#039;. And the name of the user is appended with the role they switch to, e.g. &#039;Admin User (teacher)&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Trimming navigation ====&lt;br /&gt;
&lt;br /&gt;
At this stage we could trim the navigation block, but we decide not to remove anything just yet as it would create more confusion: some nodes would accessible from the user menu, and others from the navigation block.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
For it to be used, the user menu needs to be as short as possible and not being cluttered with additional links. It will contain what has been decided above, and not being changed. The users will get used to its content and thus removing nodes is a very tough decision to make. In any case, it should not contain more than 6 links, and should always contain:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* Preferences&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
The links in the menu are very important to the user, they target user context-specific pages and nothing related to the site structure or the course. A link to &#039;My courses&#039; would be redundant as this information should be covered in the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
=== A user preferences page ===&lt;br /&gt;
&lt;br /&gt;
The preferences page is a list of links to sub-preferences page. The page will be generated from the navigation node &#039;My profile settings&#039;, though we will have to re-organise them so that each link belongs to a parent node. A link to the preferences page is added to the user menu.&lt;br /&gt;
&lt;br /&gt;
==== Re-organisation ====&lt;br /&gt;
&lt;br /&gt;
* User account&lt;br /&gt;
** Edit profile&lt;br /&gt;
** Account settings&lt;br /&gt;
** Change password&lt;br /&gt;
** Security keys&lt;br /&gt;
** Messaging&lt;br /&gt;
&lt;br /&gt;
* Blogs&lt;br /&gt;
** Preferences&lt;br /&gt;
** External blogs&lt;br /&gt;
** Register an external blog&lt;br /&gt;
&lt;br /&gt;
* Badges&lt;br /&gt;
** Manage my badges&lt;br /&gt;
** Preferences&lt;br /&gt;
** Backpack settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preferences page displays headings (the setting nodes) under which the links to the sub-pages will be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
The nodes &#039;Roles&#039; and &#039;Activity reports&#039; will not be part of this page, because they are context based: they point to the course or site context depending on the page we are on. They will remain in the navigation block, but only when the user has the capability to view them. When the only node in the &#039;My profile settings&#039; node is &#039;Preferences&#039;, then &#039;My profile settings&#039; is not displayed. Here is an example when you have the capability to view the reports and roles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblockpref.png|frame|none|alt=My profile settings node with extended capability.|My profile settings node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My profile settings&#039; node becomes the name of the user: &#039;Frédéric Massart&#039;. The &#039;Profile settings for Jetha Chan&#039; becomes &#039;Jetha Chan&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breadcrumb ====&lt;br /&gt;
&lt;br /&gt;
Each of the sub-pages should be checked to ensure that they are in the right hierarchy, the breadcrumb always looks like &#039;(User context nav) &amp;gt; Preferences &amp;gt; Preference heading &amp;gt; Page I am on&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Another user&#039;s preferences ====&lt;br /&gt;
&lt;br /&gt;
The node &#039;Profile settings for User B&#039; can be used to edit someone&#039;s settings. The content is similar to &#039;My profile settings&#039;, except that the node will always be displayed regardless of the presence of &#039;Roles&#039; or &#039;Activity reports&#039;. Currently there is no other way for a user with elevated privileges to access someone&#039;s preferences, but sooner or later the preferences will be accessible from their profiles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblocksomeonelse.png|frame|none|alt=Profile settings for X with extended capability.|Profile settings for X node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Repositories ====&lt;br /&gt;
&lt;br /&gt;
At present, repositories are configurable from the Navigation block - this is a good opportunity to move them to the &#039;Preferences&#039; page.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
Every link in this page should belong to a section, the sections are only headers that help the users finding what they are looking for. A plugin that adds user preferences related to its features should define a new heading and add its links to that heading. The heading is never clickable.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
For now we will only be focussing on the site profile of the user. Later on, we will be solving the problems linked to the course context, for instances the links to &#039;Blog&#039; or &#039;Forum interactions&#039; automatically filtered to only display the blog posts in the course.&lt;br /&gt;
&lt;br /&gt;
==== Content ====&lt;br /&gt;
&lt;br /&gt;
The contact details will be displayed in such a way that they do not look like a list any more. For instance, everyone knows what an email address is, there is no need to prefix it with &#039;Email address:&#039;.&lt;br /&gt;
&lt;br /&gt;
The badges will be displayed on the profile too.&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&lt;br /&gt;
* Edit profile (If this is your profile)&lt;br /&gt;
* Blog&lt;br /&gt;
* Forum interactions&lt;br /&gt;
* Notes (If you have the capability to)&lt;br /&gt;
* Preferences (If you have the capability to and are viewing someone&#039;s profile)&lt;br /&gt;
* Send a message&lt;br /&gt;
* Login as (If you have the capability to)&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can start trimming the node &#039;My profile&#039; a bit, but some nodes will remain until we sort out the &#039;My&#039; page. When doing so, it is important to make sure that the nodes &#039;Home &amp;gt; Some course &amp;gt; Participants &amp;gt; User B&#039; still contain everything it does right now, because those links point to course-based pages, and would not be accessible otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The profile page contains everything about the user that is public. In other words, a content specific to the user should not be displayed on the profile at all, because it would never be accessible to another user, e.g. &#039;Private files&#039;.&lt;br /&gt;
&lt;br /&gt;
There are exceptions to this rule, badges for example. As a setting allows you to define whether or not your badges are on your profile, you might not be able to see them there, so they should be available on your dashboard.&lt;br /&gt;
&lt;br /&gt;
For content controlled by permissions (and not preferences), they should remain on the profile. Take &#039;Blog&#039; as an example, an administrator can prevent blog entries from another user to be accessed depending on your role. As the user does not have any information about the roles of the other users, the blog link is displayed on the profile, but other users will not see it. Having a blog block on the &#039;My home&#039; page would not be useful because it simply duplicates the access points, for no apparent reason to the user.&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
We need to add more default blocks to the existing page, the different available blocks will be:&lt;br /&gt;
&lt;br /&gt;
* My courses (already there)&lt;br /&gt;
* My private files (already there)&lt;br /&gt;
* The calendar&lt;br /&gt;
* Upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
We need to add a link to &#039;My latest badges&#039; to the page listing all the badges.&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can now remove &#039;My profile&#039; (or now called &#039;Jetha Chan&#039;) from the navigation block entirely. But it has to still be accessible under the node of a user in a course tree.&lt;br /&gt;
&lt;br /&gt;
The node &#039;My courses&#039; is also removed, users should be used to using their dashboard to access their courses.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My home&#039; page contains everything about a user that is private and not accessible to other users. For instance, your calendar events or your private files. The list of courses you are enrolled in are an exception, they could be displayed on the user profile, but because they are so important and need to be layed out in useful fashion, they will be part of the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
This page does not need to link to pages which are already accessible from the &#039;User menu&#039;, for instance the profile.&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pending&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Accessing course grades for students&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
** Checking for inconsistencies in the breadcrumb jumping from one place to another.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
# The user menu&lt;br /&gt;
# Implementing the user &#039;header&#039; for user context pages&lt;br /&gt;
# The preferences page&lt;br /&gt;
# The new profile page&lt;br /&gt;
# Revisiting &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;To be defined.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.google.com/document/d/16BJsINun13StUFOQaejj3Gawz9jk22ir_r49f3MbInM/edit#heading=h.fuvsbkikzj88 Navigation experiment]&lt;br /&gt;
* [https://docs.google.com/document/d/1AXJw8uX6MczA5VC3phkVVv1ee5eZ2nluIiPC2ecgHLE/edit#heading=h.k3lh9alzq3iy Navigation prototyping 2.7]&lt;br /&gt;
* MDL-34838: Navigation inconsistencies&lt;br /&gt;
* [http://demo2k12.moodlerooms.com Minimal by Moodlerooms]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226791 Users’ personalised profiles]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45071</id>
		<title>Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45071"/>
		<updated>2014-05-30T08:49:12Z</updated>

		<summary type="html">&lt;p&gt;Jethac: /* Repositories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Renderer consistency&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = https://tracker.moodle.org/browse/MDL-45774&lt;br /&gt;
|discussion = -&lt;br /&gt;
|assignee = Frédéric Massart, Jetha Chan&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
Navigation throughout Moodle is often confusing and needs some improvement. With this in mind, a specification has been prepared, defining what problems were identified and how they will be solved. Particular focus will be placed upon improving the experience of students, teachers, and users unfamiliar to Moodle.&lt;br /&gt;
&lt;br /&gt;
== What can be improved ==&lt;br /&gt;
&lt;br /&gt;
Common complaints leveled at Moodle include:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unnecessary steep learning curve&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Features or options not being discovered&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;General frustration&#039;&#039;&#039; - clunkiness, a certain &#039;&#039;je ne sais quoi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The navigation is not static ===&lt;br /&gt;
&lt;br /&gt;
Sometimes when navigating from one place to another, the state of the tree in the navigation block completely changes. A good example of this is when going from a course to a module - upon arrival in a module, the Administration block will display a collapsed &#039;Course administration&#039; node and a new expanded &#039;Module administration&#039; node, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
[[File:pbnotstatic.png|frame|none|alt=Going from course to a module.|Going from course to a module.]]&lt;br /&gt;
&lt;br /&gt;
Consistency should be improved here, as it is unlikely that a user unfamiliar with the system will understand sudden collapsing of or additional nodes.&lt;br /&gt;
&lt;br /&gt;
=== Feature placement ===&lt;br /&gt;
&lt;br /&gt;
It is our opinion that some navigation nodes contain things that you wouldn&#039;t expect, and don&#039;t contain things that you &#039;&#039;&#039;would&#039;&#039; expect. For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;My profile settings&#039; contains &#039;Blogs&#039;, &#039;Badges&#039; or &#039;Messaging&#039;. These are not strictly related to your profile, they are related to your user account.&lt;br /&gt;
* What can be found under &#039;Site pages&#039;?&lt;br /&gt;
* Notes&lt;br /&gt;
** In order to view Notes taken on a course level, I first need to click on &#039;Participants&#039;, and once the page is loaded I can see new entries in the navigation node &#039;Participants&#039;. Why is this the case? Most users will not be aware of those links and will miss out on that feature, we feel.&lt;br /&gt;
&lt;br /&gt;
=== Bad naming ===&lt;br /&gt;
&lt;br /&gt;
Proper naming of the navigation helps the user remembering where to find what they are looking for. It also helps them to discover features that they would not otherwise be aware of, e.g. &#039;Calendar&#039;, hidden under &#039;Site pages&#039;. If a user has no understanding of what &#039;Site pages&#039; is, it is unlikely that they will expand it.&lt;br /&gt;
&lt;br /&gt;
Another popular(?) example of bad naming is the link &#039;My grades&#039; under &#039;Course administration&#039; in the &#039;Administration&#039; block. &#039;A student is not administrating anything, his grades are not a setting.&#039;&lt;br /&gt;
&lt;br /&gt;
=== Context jumps ===&lt;br /&gt;
&lt;br /&gt;
The breadcrumb and navigation sometimes jump from one context to another. For instance, as a student when you click on &#039;Administration &amp;gt; Course administration &amp;gt; My grades&#039;, the navigation node on which you appear to be after clicking is &#039;Administration &amp;gt; Grade administration &amp;gt; User report&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps.png|frame|none|alt=Breadcrumb context jumping.|Breadcrumb context jumping.]]&lt;br /&gt;
&lt;br /&gt;
It is also possible for the user to jump from a course context to a site context, leaving the course (different breadcrumb, different navigation) without realising it and instantly feeling lost. A common reaction would be to use the &#039;Back&#039; button of their browser to recover from it rather than trying to understand what happened. This behaviour can be observed when visiting someone&#039;s profile, viewing some reports, etc...&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps2.png|frame|none|alt=Navigation context jumping.|Navigation context jumping.]]&lt;br /&gt;
&lt;br /&gt;
In order for users to feel comfortable and confident, and to not feel lost in Moodle&#039;s complex page hierarchy, we need to prevent situations where they feel lost and frustrated.&lt;br /&gt;
&lt;br /&gt;
=== Overwhelming the user ===&lt;br /&gt;
&lt;br /&gt;
Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;.  We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&lt;br /&gt;
&lt;br /&gt;
== The goal ==&lt;br /&gt;
&lt;br /&gt;
We seek to provide navigation that is:&lt;br /&gt;
&lt;br /&gt;
* Simpler&lt;br /&gt;
* Intuitive&lt;br /&gt;
* Easy to learn&lt;br /&gt;
&lt;br /&gt;
Leading to myriad benefits, including but not limited to:&lt;br /&gt;
&lt;br /&gt;
; Efficiency&lt;br /&gt;
: Less trial and error when looking for something&lt;br /&gt;
; Common expectations being met&lt;br /&gt;
: Pages being found where you expect them to be&lt;br /&gt;
; A reduction in confusion and general frustration&lt;br /&gt;
; Less resistance&lt;br /&gt;
: New users feeling more confident using the product&lt;br /&gt;
&lt;br /&gt;
Some risk does present itself; by changing large sections of the product, we risk alienating existing experienced Moodle users, frustrated at not finding pages where they used to be. On the other hand, re-learning the navigation should be straightforward, painless and at the very least easier than learning it the first time. User documentation will also suffer in the interim, as screenshots, navigation patterns and other training materials will have to be updated.&lt;br /&gt;
&lt;br /&gt;
== Rough ideas ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of ideas gathered from discussions and resources both internal and external to HQ:&lt;br /&gt;
&lt;br /&gt;
* A student should be able to quickly access his courses, grades, settings, profile from a static place in the UI. This would remove the need for them to expand nodes in both the &#039;Navigation&#039; block and the &#039;Administration&#039; block.&lt;br /&gt;
* The different nodes of the &#039;Administration&#039; block could be displayed on a &#039;Preferences&#039; page.&lt;br /&gt;
** e.g. the &#039;Course administration&#039; items could be listed on a page, each node being a title and each of its elements listed underneath. By moving administration settings to a single page, we obviate the need for the &#039;Administration&#039; block entirely.&lt;br /&gt;
* A teacher should be able to quickly access the &#039;Options&#039; of a course through a static node, the same way a user can access anything associated to his account.&lt;br /&gt;
* Similarly for modules, an easy dropdown to access module preferences and more frequently used options could be created.&lt;br /&gt;
* Breadcrumb-based navigation to reduce and perhaps entirely remove the the need for the nested and cumbersome Navigation block.&lt;br /&gt;
** This could be problematic in regards to creating problems with accessing site pages, or pages which do not clearly have a hierarchical position.  This could be addressed by providing &#039;in context&#039; links. For instance, adding a new block entry should be available from the Blog page.&lt;br /&gt;
* Providing a sitemap page to counter the lack of &#039;Navigation&#039; block when something is not easily accessible.&lt;br /&gt;
* Ability to &#039;Star&#039; some pages to quickly access favourites.&lt;br /&gt;
* Develop a &#039;Smart search&#039; to easily access the content in the current course, other courses, etc… and the admin settings for admins.&lt;br /&gt;
* Populating my/ page with more useful content for the user itself.&lt;br /&gt;
* A new profile page on which is displayed the &#039;public&#039; information of the user. Their forum interactions, their blog, their reports, ...&lt;br /&gt;
* Providing an API to modules to implement their own navigation, thus not required to inject links in the navigation block like &#039;Chat&#039; is doing or &#039;Quiz&#039; used to do (Results report). This navigation would be displayed in a standard fashion across modules. (Tabs like in wiki?)&lt;br /&gt;
* When hovering a user&#039;s name, a menu could appear with a few details and links to their profile, etc... (like Jira does).&lt;br /&gt;
&lt;br /&gt;
== Analysis of popular themes ==&lt;br /&gt;
&lt;br /&gt;
Although most of those themes do not change anything about the navigation itself, a few have implemented a &#039;&#039;user menu&#039;&#039;. Usually displayed at the top most right of the screen, it contains links to quickly access user specific pages. The most common links are:&lt;br /&gt;
&lt;br /&gt;
* View profile&lt;br /&gt;
* Edit profile&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
Less popular links are:&lt;br /&gt;
&lt;br /&gt;
* Calendar&lt;br /&gt;
* My private files&lt;br /&gt;
* My home&lt;br /&gt;
&lt;br /&gt;
== The solutions ==&lt;br /&gt;
&lt;br /&gt;
To achieve our goal we have to remove the need for the administration and navigation blocks. This is a long process that needs to be broken down into sub-solutions. Some will need to be developed simultaneously to avoid half-baked temporary solutions. Those solutions can be split into two categories: &#039;User&#039;, and &#039;Course&#039;.&lt;br /&gt;
&lt;br /&gt;
User solutions:&lt;br /&gt;
&lt;br /&gt;
* A user menu&lt;br /&gt;
* A user preferences page&lt;br /&gt;
* A new profile page&lt;br /&gt;
* Revisiting &#039;My home&#039; page&lt;br /&gt;
&lt;br /&gt;
Course solutions:&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* A course &#039;Quick access&#039; menu&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
&lt;br /&gt;
The user menu is a dropdown containing links to pages specific to user. They are context independent and will always point to the same pages. The user menu can always be found at the same place in the user interface and will contain the following links:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* My grades&lt;br /&gt;
* Messages&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
[[File:usermenu.png|frame|none|alt=A user menu.|A user menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Gives quick and intuitive access to the user specific pages&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Emphasises the page &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== User preferences page ===&lt;br /&gt;
&lt;br /&gt;
A link to that page would be placed in the user menu. That page will contain most of what the user has control over on a site level. Their mailing preferences, changing their password, etc... but reorganised.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* We can remove &#039;My profile settings&#039; from the &#039;Administration&#039; block.&lt;br /&gt;
* The settings are all reachable from one place.&lt;br /&gt;
* New pages will help the user understanding what settings they have control over.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
By adding new content to the profile page, we can trim a bit more the navigation block. The profile page is supposed to contain anything you could find about a user, and there will be links to their blog, forum interactions, notes, to send them a message, etc...&lt;br /&gt;
&lt;br /&gt;
We will keep the distinction between the full profile and the course profiles, at this stage we only improve the site profile because the course profiles need more thoughts and are tied to the course solutions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Answering concerns of the &#039;User preferences page&#039;&lt;br /&gt;
* Bonus: the profile page has a reason to be visited&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
The My/ page is underused and does not contain enough valuable information for the users to visit it. We will update it to include more user-specific content. It will contain:&lt;br /&gt;
&lt;br /&gt;
* My courses&lt;br /&gt;
* My private files&lt;br /&gt;
* The calendar and upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
[[File:myhome.png|frame|none|alt=The new dashboard.|The new dashboard.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;, at this point it should be empty&lt;br /&gt;
* Making the my/ page more interesting and valuable&lt;br /&gt;
&lt;br /&gt;
=== Handling of course profiles ===&lt;br /&gt;
&lt;br /&gt;
We need to remove the confusion between site and course profiles, only a few more informations should be available when viewing a &#039;Course profile&#039;, but we do not need an entirely different profile for that purpose. The course specific information will be accessible from the user profile, but be in the context of the site profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No more course profile pages&lt;br /&gt;
&lt;br /&gt;
=== A course &#039;Quick access&#039; menu ===&lt;br /&gt;
&lt;br /&gt;
In order to remove the need for the nodes &#039;Participants&#039; and &#039;Badges&#039; from the &#039;Course&#039; entry in the &#039;Navigation block&#039;, and the &#039;Grades&#039; entry in the &#039;Course administration&#039; node (for students), we will implement a new &#039;Quick access&#039; menu for the course. This menu will be accessible on any page within a course, or module.&lt;br /&gt;
&lt;br /&gt;
This menu will only contain links to the 3 entries mentioned above. If later on we add more links to that list, the additional (and less important) entries will be displayed in a dropdown, or a in a &#039;More&#039; page.&lt;br /&gt;
&lt;br /&gt;
A new grades page will be created for students to access their course grades.&lt;br /&gt;
&lt;br /&gt;
It is important to keep the visible elements of this menu to a minimum. Not more than 3 elements should be displayed at a time. An exception can be made for users with more privileges who will see a &#039;Settings&#039; (or &#039;Administration&#039;) link, and perhaps a &#039;Reports&#039; one when we will work on them (see the following the other solutions below).&lt;br /&gt;
&lt;br /&gt;
To unenrol yourself from a course, you would not look into the &#039;Course administration&#039; node, you would rather find a link on &#039;My home&#039; page next to the list of courses to unenrol yourself from them.&lt;br /&gt;
&lt;br /&gt;
[[File:coursemenu.png|frame|none|alt=An example of a course quick-access menu.|An example of a course quick-access menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming the navigation block&lt;br /&gt;
* Removing the &#039;Course administration&#039; node for students&lt;br /&gt;
* Dedicated grades page for the students&lt;br /&gt;
* Quick access to the most important pages of a course&lt;br /&gt;
&lt;br /&gt;
=== An administration page per module ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the module would list everything that was originally in the &#039;Module administration&#039; node, but reorganised to be more intuitive. A link to that page would be placed somewhere in the general UI.&lt;br /&gt;
&lt;br /&gt;
The modules abusing the &#039;Adminstration&#039; block to inject new pages into their module should be updated to provide a module navigation instead. It could be a list of links in the module page, or a module navigation such as tabs, this is probably tied to the solution &#039;Alternative site and course navigation&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the module administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* Removes the need for the &#039;Module administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
&lt;br /&gt;
=== An administration page for the course ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the course would list everything that was originally in the &#039;Course administration&#039; node, but reorganised to be more intuitive. A link to that page will be added to the course &#039;Quick access&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the course administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* No more &#039;Course administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
* Reports would be accessible from that page until &#039;Dedicated solution to access reports&#039; is implemented&lt;br /&gt;
&lt;br /&gt;
=== Dedicated solution to access reports ===&lt;br /&gt;
&lt;br /&gt;
Reports are the black sheep of the navigation, nobody agrees on where they should be and they are moved around every so often. Perhaps nobody agrees because they do not belong either in the navigation or the administration block.&lt;br /&gt;
&lt;br /&gt;
Currently they are accessed from the &#039;Administration&#039; block, and as we are moving the content of the block to administration pages, that is where they will end up. This is surely not better (perhaps even worse) than where they were before, so why not thinking once and for all where they should be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/!\ Solution needed!&lt;br /&gt;
&lt;br /&gt;
Idea: We could add a &#039;Report&#039; menu to the course &#039;Quick access&#039; menu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Standardised way to access reports&lt;br /&gt;
* A navigation that does not jump somewhere else when viewing a report&lt;br /&gt;
&lt;br /&gt;
=== Alternative site and course navigation ===&lt;br /&gt;
&lt;br /&gt;
Now, that everything else has been sorted out, we can will be able to remove the navigation block, but first we need to sort out how to navigate at the site and course levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Site level&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The frontpage would just be an entry point. The navigation node &#039;Site pages&#039; will be displayed in a block specific to the site pages. Once you leave the context of the &#039;Site&#039;, you will be in a course. Most users will not go back to the front page, except to find some information specific to their institution. To navigate between their courses, teachers and students would refer to their my/ page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, pages like &#039;Participants&#039;, &#039;Badges&#039; or &#039;Tags&#039; could be accessed from their context, for instance in a &#039;Online users&#039; block which would link to &#039;All participants&#039;. The same applies for &#039;Calendar&#039;, but is already the case because of the block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course level&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The concept of site would disappear as soon as you get in a course. A student or teacher would then focus 100% on the course they are browsing rather than being distracted by site elements.&lt;br /&gt;
&lt;br /&gt;
The course format will be responsible for most of the navigation in the course:&lt;br /&gt;
&lt;br /&gt;
* Injecting a block to navigate between sections&lt;br /&gt;
* Injecting a block to navigate between modules&lt;br /&gt;
* Injecting a block that does both of the above (very similar to the course node in the navigation block)&lt;br /&gt;
* Injecting links &#039;Go to next activity&#039;, &#039;Go back to course&#039;, ... into module views.&lt;br /&gt;
&lt;br /&gt;
The course format will also have control over the course &#039;Quick access&#039; menu, in which it could inject/remove items if they wanted to.&lt;br /&gt;
&lt;br /&gt;
The node &#039;Switch role&#039; disappears from the administration block and we now require a &#039;Switch role&#039; block to be added to the course to unlock that functionality. This block would only be displayed to users having the capabilities to switch role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Future of the Administration block&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, the administration block will not be displayed to any user, except the ones with elevated privileges. Administrators, managers or course creators will still have access to the administration block but it will only contain the &#039;Site administration&#039; node.&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
All the pages on a user context will all have their own layout where the header includes the name of the user in a standardised way, along with some information and a link to message them, and their preferences if the logged in user has the capabilities to edit them. A renderer will be responsible for creating the header, and will use the user ID found from the context defined on that page.&lt;br /&gt;
&lt;br /&gt;
The navigation within the context pages will be:&lt;br /&gt;
&lt;br /&gt;
; For your own context&lt;br /&gt;
: Home &amp;gt; Your Name &amp;gt; Page you are on. Clicking on &#039;Your Name&#039; will lead you to &#039;My home&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader.png|frame|none|alt=The header when viewing your context.|The header when your context.]]&lt;br /&gt;
&lt;br /&gt;
; For other users&#039; context&lt;br /&gt;
: Home &amp;gt; Users &amp;gt; User Name &amp;gt; Page you are on. Clicking on &#039;User Name&#039; will lead you to their profile.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader2.png|frame|none|alt=The header when viewing someone else&#039;s context.|The header when viewing someone else&#039;s context.]]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The user header contains very simplistic information about the user, and a few links to very common actions in regard to other users. For instance it can implement a link to send a message to the user, because you might want to be able to do that regardless of what user context page you are visiting. But, &#039;Edit profile&#039; should not be in it, because it is only relevant to the profile. It is very important to keep the number of available actions to a minimum, because having too many options would defeat the purpose of the simplicity and efficiency it is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== A user menu ===&lt;br /&gt;
&lt;br /&gt;
The new user menu would be a new renderer, called from the layout files as it was the case for the login info renderer. The content of the user menu is fixed and not configurable, however it is possible to override the renderer from a theme to change its layout and content.&lt;br /&gt;
&lt;br /&gt;
==== Design ====&lt;br /&gt;
&lt;br /&gt;
Placed on the top right of the site, the name of the user is displayed next to a user icon. The dropdown is displayed when the user clicks the icon or the name. On smaller screens only a user icon is displayed, and expands to reveal its content. When expanded the name of the user logged in is displayed.&lt;br /&gt;
&lt;br /&gt;
When the user is not logged in, a login link is displayed, regardless of the screen size.&lt;br /&gt;
&lt;br /&gt;
==== My grades ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My grades&#039; page will display the overall grades of the student in all their visible courses. The ordering can be changed, but the default would be alphabetical.&lt;br /&gt;
&lt;br /&gt;
==== Login as ====&lt;br /&gt;
&lt;br /&gt;
When logged in as someone else, the &#039;Logout&#039; entry becomes &#039;Return to Admin User&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Switch role ====&lt;br /&gt;
&lt;br /&gt;
When the user role is switched, the &#039;Logout&#039; entry becomes &#039;Return to my normal role&#039;. And the name of the user is appended with the role they switch to, e.g. &#039;Admin User (teacher)&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Trimming navigation ====&lt;br /&gt;
&lt;br /&gt;
At this stage we could trim the navigation block, but we decide not to remove anything just yet as it would create more confusion: some nodes would accessible from the user menu, and others from the navigation block.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
For it to be used, the user menu needs to be as short as possible and not being cluttered with additional links. It will contain what has been decided above, and not being changed. The users will get used to its content and thus removing nodes is a very tough decision to make. In any case, it should not contain more than 6 links, and should always contain:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* Preferences&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
The links in the menu are very important to the user, they target user context-specific pages and nothing related to the site structure or the course. A link to &#039;My courses&#039; would be redundant as this information should be covered in the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
=== A user preferences page ===&lt;br /&gt;
&lt;br /&gt;
The preferences page is a list of links to sub-preferences page. The page will be generated from the navigation node &#039;My profile settings&#039;, though we will have to re-organise them so that each link belongs to a parent node. A link to the preferences page is added to the user menu.&lt;br /&gt;
&lt;br /&gt;
==== Re-organisation ====&lt;br /&gt;
&lt;br /&gt;
* User account&lt;br /&gt;
** Edit profile&lt;br /&gt;
** Account settings&lt;br /&gt;
** Change password&lt;br /&gt;
** Security keys&lt;br /&gt;
** Messaging&lt;br /&gt;
&lt;br /&gt;
* Blogs&lt;br /&gt;
** Preferences&lt;br /&gt;
** External blogs&lt;br /&gt;
** Register an external blog&lt;br /&gt;
&lt;br /&gt;
* Badges&lt;br /&gt;
** Manage my badges&lt;br /&gt;
** Preferences&lt;br /&gt;
** Backpack settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preferences page displays headings (the setting nodes) under which the links to the sub-pages will be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]&lt;br /&gt;
&lt;br /&gt;
The nodes &#039;Roles&#039; and &#039;Activity reports&#039; will not be part of this page, because they are context based: they point to the course or site context depending on the page we are on. They will remain in the navigation block, but only when the user has the capability to view them. When the only node in the &#039;My profile settings&#039; node is &#039;Preferences&#039;, then &#039;My profile settings&#039; is not displayed. Here is an example when you have the capability to view the reports and roles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblockpref.png|frame|none|alt=My profile settings node with extended capability.|My profile settings node with extended capability.]&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My profile settings&#039; node becomes the name of the user: &#039;Frédéric Massart&#039;. The &#039;Profile settings for Jetha Chan&#039; becomes &#039;Jetha Chan&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breadcrumb ====&lt;br /&gt;
&lt;br /&gt;
Each of the sub-pages should be checked to ensure that they are in the right hierarchy, the breadcrumb always looks like &#039;(User context nav) &amp;gt; Preferences &amp;gt; Preference heading &amp;gt; Page I am on&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Another user&#039;s preferences ====&lt;br /&gt;
&lt;br /&gt;
The node &#039;Profile settings for User B&#039; can be used to edit someone&#039;s settings. The content is similar to &#039;My profile settings&#039;, except that the node will always be displayed regardless of the presence of &#039;Roles&#039; or &#039;Activity reports&#039;. Currently there is no other way for a user with elevated privileges to access someone&#039;s preferences, but sooner or later the preferences will be accessible from their profiles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblocksomeonelse.png|frame|none|alt=Profile settings for X with extended capability.|Profile settings for X node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Repositories ====&lt;br /&gt;
&lt;br /&gt;
At present, repositories are configurable from the Navigation block - this is a good opportunity to move them to the &#039;Preferences&#039; page.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
Every link in this page should belong to a section, the sections are only headers that help the users finding what they are looking for. A plugin that adds user preferences related to its features should define a new heading and add its links to that heading. The heading is never clickable.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
For now we will only be focussing on the site profile of the user. Later on, we will be solving the problems linked to the course context, for instances the links to &#039;Blog&#039; or &#039;Forum interactions&#039; automatically filtered to only display the blog posts in the course.&lt;br /&gt;
&lt;br /&gt;
==== Content ====&lt;br /&gt;
&lt;br /&gt;
The contact details will be displayed in such a way that they do not look like a list any more. For instance, everyone knows what an email address is, there is no need to prefix it with &#039;Email address:&#039;.&lt;br /&gt;
&lt;br /&gt;
The badges will be displayed on the profile too.&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&lt;br /&gt;
* Edit profile (If this is your profile)&lt;br /&gt;
* Blog&lt;br /&gt;
* Forum interactions&lt;br /&gt;
* Notes (If you have the capability to)&lt;br /&gt;
* Preferences (If you have the capability to and are viewing someone&#039;s profile)&lt;br /&gt;
* Send a message&lt;br /&gt;
* Login as (If you have the capability to)&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can start trimming the node &#039;My profile&#039; a bit, but some nodes will remain until we sort out the &#039;My&#039; page. When doing so, it is important to make sure that the nodes &#039;Home &amp;gt; Some course &amp;gt; Participants &amp;gt; User B&#039; still contain everything it does right now, because those links point to course-based pages, and would not be accessible otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The profile page contains everything about the user that is public. In other words, a content specific to the user should not be displayed on the profile at all, because it would never be accessible to another user, e.g. &#039;Private files&#039;.&lt;br /&gt;
&lt;br /&gt;
There are exceptions to this rule, badges for example. As a setting allows you to define whether or not your badges are on your profile, you might not be able to see them there, so they should be available on your dashboard.&lt;br /&gt;
&lt;br /&gt;
For content controlled by permissions (and not preferences), they should remain on the profile. Take &#039;Blog&#039; as an example, an administrator can prevent blog entries from another user to be accessed depending on your role. As the user does not have any information about the roles of the other users, the blog link is displayed on the profile, but other users will not see it. Having a blog block on the &#039;My home&#039; page would not be useful because it simply duplicates the access points, for no apparent reason to the user.&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
We need to add more default blocks to the existing page, the different available blocks will be:&lt;br /&gt;
&lt;br /&gt;
* My courses (already there)&lt;br /&gt;
* My private files (already there)&lt;br /&gt;
* The calendar&lt;br /&gt;
* Upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
We need to add a link to &#039;My latest badges&#039; to the page listing all the badges.&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can now remove &#039;My profile&#039; (or now called &#039;Jetha Chan&#039;) from the navigation block entirely. But it has to still be accessible under the node of a user in a course tree.&lt;br /&gt;
&lt;br /&gt;
The node &#039;My courses&#039; is also removed, users should be used to using their dashboard to access their courses.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My home&#039; page contains everything about a user that is private and not accessible to other users. For instance, your calendar events or your private files. The list of courses you are enrolled in are an exception, they could be displayed on the user profile, but because they are so important and need to be layed out in useful fashion, they will be part of the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
This page does not need to link to pages which are already accessible from the &#039;User menu&#039;, for instance the profile.&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pending&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Accessing course grades for students&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
** Checking for inconsistencies in the breadcrumb jumping from one place to another.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
# The user menu&lt;br /&gt;
# Implementing the user &#039;header&#039; for user context pages&lt;br /&gt;
# The preferences page&lt;br /&gt;
# The new profile page&lt;br /&gt;
# Revisiting &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;To be defined.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.google.com/document/d/16BJsINun13StUFOQaejj3Gawz9jk22ir_r49f3MbInM/edit#heading=h.fuvsbkikzj88 Navigation experiment]&lt;br /&gt;
* [https://docs.google.com/document/d/1AXJw8uX6MczA5VC3phkVVv1ee5eZ2nluIiPC2ecgHLE/edit#heading=h.k3lh9alzq3iy Navigation prototyping 2.7]&lt;br /&gt;
* MDL-34838: Navigation inconsistencies&lt;br /&gt;
* [http://demo2k12.moodlerooms.com Minimal by Moodlerooms]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226791 Users’ personalised profiles]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45069</id>
		<title>Navigation overhaul specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Navigation_overhaul_specification&amp;diff=45069"/>
		<updated>2014-05-30T08:44:38Z</updated>

		<summary type="html">&lt;p&gt;Jethac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Renderer consistency&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = https://tracker.moodle.org/browse/MDL-45774&lt;br /&gt;
|discussion = -&lt;br /&gt;
|assignee = Frédéric Massart, Jetha Chan&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
Navigation throughout Moodle is often confusing and needs some improvement. With this in mind, a specification has been prepared, defining what problems were identified and how they will be solved. Particular focus will be placed upon improving the experience of students, teachers, and users unfamiliar to Moodle.&lt;br /&gt;
&lt;br /&gt;
== What can be improved ==&lt;br /&gt;
&lt;br /&gt;
Common complaints leveled at Moodle include:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unnecessary steep learning curve&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Features or options not being discovered&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;General frustration&#039;&#039;&#039; - clunkiness, a certain &#039;&#039;je ne sais quoi&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The navigation is not static ===&lt;br /&gt;
&lt;br /&gt;
Sometimes when navigating from one place to another, the state of the tree in the navigation block completely changes. A good example of this is when going from a course to a module - upon arrival in a module, the Administration block will display a collapsed &#039;Course administration&#039; node and a new expanded &#039;Module administration&#039; node, as illustrated below.&lt;br /&gt;
&lt;br /&gt;
[[File:pbnotstatic.png|frame|none|alt=Going from course to a module.|Going from course to a module.]]&lt;br /&gt;
&lt;br /&gt;
Consistency should be improved here, as it is unlikely that a user unfamiliar with the system will understand sudden collapsing of or additional nodes.&lt;br /&gt;
&lt;br /&gt;
=== Feature placement ===&lt;br /&gt;
&lt;br /&gt;
It is our opinion that some navigation nodes contain things that you wouldn&#039;t expect, and don&#039;t contain things that you &#039;&#039;&#039;would&#039;&#039; expect. For example:&lt;br /&gt;
&lt;br /&gt;
* &#039;My profile settings&#039; contains &#039;Blogs&#039;, &#039;Badges&#039; or &#039;Messaging&#039;. These are not strictly related to your profile, they are related to your user account.&lt;br /&gt;
* What can be found under &#039;Site pages&#039;?&lt;br /&gt;
* Notes&lt;br /&gt;
** In order to view Notes taken on a course level, I first need to click on &#039;Participants&#039;, and once the page is loaded I can see new entries in the navigation node &#039;Participants&#039;. Why is this the case? Most users will not be aware of those links and will miss out on that feature, we feel.&lt;br /&gt;
&lt;br /&gt;
=== Bad naming ===&lt;br /&gt;
&lt;br /&gt;
Proper naming of the navigation helps the user remembering where to find what they are looking for. It also helps them to discover features that they would not otherwise be aware of, e.g. &#039;Calendar&#039;, hidden under &#039;Site pages&#039;. If a user has no understanding of what &#039;Site pages&#039; is, it is unlikely that they will expand it.&lt;br /&gt;
&lt;br /&gt;
Another popular(?) example of bad naming is the link &#039;My grades&#039; under &#039;Course administration&#039; in the &#039;Administration&#039; block. &#039;A student is not administrating anything, his grades are not a setting.&#039;&lt;br /&gt;
&lt;br /&gt;
=== Context jumps ===&lt;br /&gt;
&lt;br /&gt;
The breadcrumb and navigation sometimes jump from one context to another. For instance, as a student when you click on &#039;Administration &amp;gt; Course administration &amp;gt; My grades&#039;, the navigation node on which you appear to be after clicking is &#039;Administration &amp;gt; Grade administration &amp;gt; User report&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps.png|frame|none|alt=Breadcrumb context jumping.|Breadcrumb context jumping.]]&lt;br /&gt;
&lt;br /&gt;
It is also possible for the user to jump from a course context to a site context, leaving the course (different breadcrumb, different navigation) without realising it and instantly feeling lost. A common reaction would be to use the &#039;Back&#039; button of their browser to recover from it rather than trying to understand what happened. This behaviour can be observed when visiting someone&#039;s profile, viewing some reports, etc...&lt;br /&gt;
&lt;br /&gt;
[[File:pbcontextjumps2.png|frame|none|alt=Navigation context jumping.|Navigation context jumping.]]&lt;br /&gt;
&lt;br /&gt;
In order for users to feel comfortable and confident, and to not feel lost in Moodle&#039;s complex page hierarchy, we need to prevent situations where they feel lost and frustrated.&lt;br /&gt;
&lt;br /&gt;
=== Overwhelming the user ===&lt;br /&gt;
&lt;br /&gt;
Both the navigation block and the administration block can potentially have lots of nodes in them, resulting in what is popularly derided as the &amp;quot;scroll of death&amp;quot;.  We posit that a good navigation system should be simple and concise, and not necessarily contain the entire site map.&lt;br /&gt;
&lt;br /&gt;
== The goal ==&lt;br /&gt;
&lt;br /&gt;
We seek to provide navigation that is:&lt;br /&gt;
&lt;br /&gt;
* Simpler&lt;br /&gt;
* Intuitive&lt;br /&gt;
* Easy to learn&lt;br /&gt;
&lt;br /&gt;
Leading to myriad benefits, including but not limited to:&lt;br /&gt;
&lt;br /&gt;
; Efficiency&lt;br /&gt;
: Less trial and error when looking for something&lt;br /&gt;
; Common expectations being met&lt;br /&gt;
: Pages being found where you expect them to be&lt;br /&gt;
; A reduction in confusion and general frustration&lt;br /&gt;
; Less resistance&lt;br /&gt;
: New users feeling more confident using the product&lt;br /&gt;
&lt;br /&gt;
Some risk does present itself; by changing large sections of the product, we risk alienating existing experienced Moodle users, frustrated at not finding pages where they used to be. On the other hand, re-learning the navigation should be straightforward, painless and at the very least easier than learning it the first time. User documentation will also suffer in the interim, as screenshots, navigation patterns and other training materials will have to be updated.&lt;br /&gt;
&lt;br /&gt;
== Rough ideas ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of ideas gathered from discussions and resources both internal and external to HQ:&lt;br /&gt;
&lt;br /&gt;
* A student should be able to quickly access his courses, grades, settings, profile from a static place in the UI. This would remove the need for them to expand nodes in both the &#039;Navigation&#039; block and the &#039;Administration&#039; block.&lt;br /&gt;
* The different nodes of the &#039;Administration&#039; block could be displayed on a &#039;Preferences&#039; page.&lt;br /&gt;
** e.g. the &#039;Course administration&#039; items could be listed on a page, each node being a title and each of its elements listed underneath. By moving administration settings to a single page, we obviate the need for the &#039;Administration&#039; block entirely.&lt;br /&gt;
* A teacher should be able to quickly access the &#039;Options&#039; of a course through a static node, the same way a user can access anything associated to his account.&lt;br /&gt;
* Similarly for modules, an easy dropdown to access module preferences and more frequently used options could be created.&lt;br /&gt;
* Breadcrumb-based navigation to reduce and perhaps entirely remove the the need for the nested and cumbersome Navigation block.&lt;br /&gt;
** This could be problematic in regards to creating problems with accessing site pages, or pages which do not clearly have a hierarchical position.  This could be addressed by providing &#039;in context&#039; links. For instance, adding a new block entry should be available from the Blog page.&lt;br /&gt;
* Providing a sitemap page to counter the lack of &#039;Navigation&#039; block when something is not easily accessible.&lt;br /&gt;
* Ability to &#039;Star&#039; some pages to quickly access favourites.&lt;br /&gt;
* Develop a &#039;Smart search&#039; to easily access the content in the current course, other courses, etc… and the admin settings for admins.&lt;br /&gt;
* Populating my/ page with more useful content for the user itself.&lt;br /&gt;
* A new profile page on which is displayed the &#039;public&#039; information of the user. Their forum interactions, their blog, their reports, ...&lt;br /&gt;
* Providing an API to modules to implement their own navigation, thus not required to inject links in the navigation block like &#039;Chat&#039; is doing or &#039;Quiz&#039; used to do (Results report). This navigation would be displayed in a standard fashion across modules. (Tabs like in wiki?)&lt;br /&gt;
* When hovering a user&#039;s name, a menu could appear with a few details and links to their profile, etc... (like Jira does).&lt;br /&gt;
&lt;br /&gt;
== Analysis of popular themes ==&lt;br /&gt;
&lt;br /&gt;
Although most of those themes do not change anything about the navigation itself, a few have implemented a &#039;&#039;user menu&#039;&#039;. Usually displayed at the top most right of the screen, it contains links to quickly access user specific pages. The most common links are:&lt;br /&gt;
&lt;br /&gt;
* View profile&lt;br /&gt;
* Edit profile&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
Less popular links are:&lt;br /&gt;
&lt;br /&gt;
* Calendar&lt;br /&gt;
* My private files&lt;br /&gt;
* My home&lt;br /&gt;
&lt;br /&gt;
== The solutions ==&lt;br /&gt;
&lt;br /&gt;
To achieve our goal we have to remove the need for the administration and navigation blocks. This is a long process that needs to be broken down into sub-solutions. Some will need to be developed simultaneously to avoid half-baked temporary solutions. Those solutions can be split into two categories: &#039;User&#039;, and &#039;Course&#039;.&lt;br /&gt;
&lt;br /&gt;
User solutions:&lt;br /&gt;
&lt;br /&gt;
* A user menu&lt;br /&gt;
* A user preferences page&lt;br /&gt;
* A new profile page&lt;br /&gt;
* Revisiting &#039;My home&#039; page&lt;br /&gt;
&lt;br /&gt;
Course solutions:&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* A course &#039;Quick access&#039; menu&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
&lt;br /&gt;
=== User menu ===&lt;br /&gt;
&lt;br /&gt;
The user menu is a dropdown containing links to pages specific to user. They are context independent and will always point to the same pages. The user menu can always be found at the same place in the user interface and will contain the following links:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* My grades&lt;br /&gt;
* Messages&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
[[File:usermenu.png|frame|none|alt=A user menu.|A user menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Gives quick and intuitive access to the user specific pages&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Emphasises the page &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== User preferences page ===&lt;br /&gt;
&lt;br /&gt;
A link to that page would be placed in the user menu. That page will contain most of what the user has control over on a site level. Their mailing preferences, changing their password, etc... but reorganised.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* We can remove &#039;My profile settings&#039; from the &#039;Administration&#039; block.&lt;br /&gt;
* The settings are all reachable from one place.&lt;br /&gt;
* New pages will help the user understanding what settings they have control over.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
By adding new content to the profile page, we can trim a bit more the navigation block. The profile page is supposed to contain anything you could find about a user, and there will be links to their blog, forum interactions, notes, to send them a message, etc...&lt;br /&gt;
&lt;br /&gt;
We will keep the distinction between the full profile and the course profiles, at this stage we only improve the site profile because the course profiles need more thoughts and are tied to the course solutions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;&lt;br /&gt;
* Answering concerns of the &#039;User preferences page&#039;&lt;br /&gt;
* Bonus: the profile page has a reason to be visited&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
The My/ page is underused and does not contain enough valuable information for the users to visit it. We will update it to include more user-specific content. It will contain:&lt;br /&gt;
&lt;br /&gt;
* My courses&lt;br /&gt;
* My private files&lt;br /&gt;
* The calendar and upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
[[File:myhome.png|frame|none|alt=The new dashboard.|The new dashboard.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming down &#039;Navigation &amp;gt; My profile&#039;, at this point it should be empty&lt;br /&gt;
* Making the my/ page more interesting and valuable&lt;br /&gt;
&lt;br /&gt;
=== Handling of course profiles ===&lt;br /&gt;
&lt;br /&gt;
We need to remove the confusion between site and course profiles, only a few more informations should be available when viewing a &#039;Course profile&#039;, but we do not need an entirely different profile for that purpose. The course specific information will be accessible from the user profile, but be in the context of the site profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No more course profile pages&lt;br /&gt;
&lt;br /&gt;
=== A course &#039;Quick access&#039; menu ===&lt;br /&gt;
&lt;br /&gt;
In order to remove the need for the nodes &#039;Participants&#039; and &#039;Badges&#039; from the &#039;Course&#039; entry in the &#039;Navigation block&#039;, and the &#039;Grades&#039; entry in the &#039;Course administration&#039; node (for students), we will implement a new &#039;Quick access&#039; menu for the course. This menu will be accessible on any page within a course, or module.&lt;br /&gt;
&lt;br /&gt;
This menu will only contain links to the 3 entries mentioned above. If later on we add more links to that list, the additional (and less important) entries will be displayed in a dropdown, or a in a &#039;More&#039; page.&lt;br /&gt;
&lt;br /&gt;
A new grades page will be created for students to access their course grades.&lt;br /&gt;
&lt;br /&gt;
It is important to keep the visible elements of this menu to a minimum. Not more than 3 elements should be displayed at a time. An exception can be made for users with more privileges who will see a &#039;Settings&#039; (or &#039;Administration&#039;) link, and perhaps a &#039;Reports&#039; one when we will work on them (see the following the other solutions below).&lt;br /&gt;
&lt;br /&gt;
To unenrol yourself from a course, you would not look into the &#039;Course administration&#039; node, you would rather find a link on &#039;My home&#039; page next to the list of courses to unenrol yourself from them.&lt;br /&gt;
&lt;br /&gt;
[[File:coursemenu.png|frame|none|alt=An example of a course quick-access menu.|An example of a course quick-access menu.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Trimming the navigation block&lt;br /&gt;
* Removing the &#039;Course administration&#039; node for students&lt;br /&gt;
* Dedicated grades page for the students&lt;br /&gt;
* Quick access to the most important pages of a course&lt;br /&gt;
&lt;br /&gt;
=== An administration page per module ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the module would list everything that was originally in the &#039;Module administration&#039; node, but reorganised to be more intuitive. A link to that page would be placed somewhere in the general UI.&lt;br /&gt;
&lt;br /&gt;
The modules abusing the &#039;Adminstration&#039; block to inject new pages into their module should be updated to provide a module navigation instead. It could be a list of links in the module page, or a module navigation such as tabs, this is probably tied to the solution &#039;Alternative site and course navigation&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the module administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* Removes the need for the &#039;Module administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
&lt;br /&gt;
=== An administration page for the course ===&lt;br /&gt;
&lt;br /&gt;
The same way we would have a &#039;Preferences&#039; page for the user, the administration page for the course would list everything that was originally in the &#039;Course administration&#039; node, but reorganised to be more intuitive. A link to that page will be added to the course &#039;Quick access&#039; menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Intuitive access to all the course administration pages&lt;br /&gt;
* Self-contained and self-explanatory&lt;br /&gt;
* No more &#039;Course administration&#039; node&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Concerns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Potentially more clicks-to-destination&lt;br /&gt;
* Reports would be accessible from that page until &#039;Dedicated solution to access reports&#039; is implemented&lt;br /&gt;
&lt;br /&gt;
=== Dedicated solution to access reports ===&lt;br /&gt;
&lt;br /&gt;
Reports are the black sheep of the navigation, nobody agrees on where they should be and they are moved around every so often. Perhaps nobody agrees because they do not belong either in the navigation or the administration block.&lt;br /&gt;
&lt;br /&gt;
Currently they are accessed from the &#039;Administration&#039; block, and as we are moving the content of the block to administration pages, that is where they will end up. This is surely not better (perhaps even worse) than where they were before, so why not thinking once and for all where they should be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/!\ Solution needed!&lt;br /&gt;
&lt;br /&gt;
Idea: We could add a &#039;Report&#039; menu to the course &#039;Quick access&#039; menu&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goals&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Standardised way to access reports&lt;br /&gt;
* A navigation that does not jump somewhere else when viewing a report&lt;br /&gt;
&lt;br /&gt;
=== Alternative site and course navigation ===&lt;br /&gt;
&lt;br /&gt;
Now, that everything else has been sorted out, we can will be able to remove the navigation block, but first we need to sort out how to navigate at the site and course levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Site level&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The frontpage would just be an entry point. The navigation node &#039;Site pages&#039; will be displayed in a block specific to the site pages. Once you leave the context of the &#039;Site&#039;, you will be in a course. Most users will not go back to the front page, except to find some information specific to their institution. To navigate between their courses, teachers and students would refer to their my/ page.&lt;br /&gt;
&lt;br /&gt;
Alternatively, pages like &#039;Participants&#039;, &#039;Badges&#039; or &#039;Tags&#039; could be accessed from their context, for instance in a &#039;Online users&#039; block which would link to &#039;All participants&#039;. The same applies for &#039;Calendar&#039;, but is already the case because of the block.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course level&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The concept of site would disappear as soon as you get in a course. A student or teacher would then focus 100% on the course they are browsing rather than being distracted by site elements.&lt;br /&gt;
&lt;br /&gt;
The course format will be responsible for most of the navigation in the course:&lt;br /&gt;
&lt;br /&gt;
* Injecting a block to navigate between sections&lt;br /&gt;
* Injecting a block to navigate between modules&lt;br /&gt;
* Injecting a block that does both of the above (very similar to the course node in the navigation block)&lt;br /&gt;
* Injecting links &#039;Go to next activity&#039;, &#039;Go back to course&#039;, ... into module views.&lt;br /&gt;
&lt;br /&gt;
The course format will also have control over the course &#039;Quick access&#039; menu, in which it could inject/remove items if they wanted to.&lt;br /&gt;
&lt;br /&gt;
The node &#039;Switch role&#039; disappears from the administration block and we now require a &#039;Switch role&#039; block to be added to the course to unlock that functionality. This block would only be displayed to users having the capabilities to switch role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Future of the Administration block&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At this point, the administration block will not be displayed to any user, except the ones with elevated privileges. Administrators, managers or course creators will still have access to the administration block but it will only contain the &#039;Site administration&#039; node.&lt;br /&gt;
&lt;br /&gt;
== Implementation details ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
All the pages on a user context will all have their own layout where the header includes the name of the user in a standardised way, along with some information and a link to message them, and their preferences if the logged in user has the capabilities to edit them. A renderer will be responsible for creating the header, and will use the user ID found from the context defined on that page.&lt;br /&gt;
&lt;br /&gt;
The navigation within the context pages will be:&lt;br /&gt;
&lt;br /&gt;
; For your own context&lt;br /&gt;
: Home &amp;gt; Your Name &amp;gt; Page you are on. Clicking on &#039;Your Name&#039; will lead you to &#039;My home&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader.png|frame|none|alt=The header when viewing your context.|The header when your context.]]&lt;br /&gt;
&lt;br /&gt;
; For other users&#039; context&lt;br /&gt;
: Home &amp;gt; Users &amp;gt; User Name &amp;gt; Page you are on. Clicking on &#039;User Name&#039; will lead you to their profile.&lt;br /&gt;
&lt;br /&gt;
[[File:userheader2.png|frame|none|alt=The header when viewing someone else&#039;s context.|The header when viewing someone else&#039;s context.]]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The user header contains very simplistic information about the user, and a few links to very common actions in regard to other users. For instance it can implement a link to send a message to the user, because you might want to be able to do that regardless of what user context page you are visiting. But, &#039;Edit profile&#039; should not be in it, because it is only relevant to the profile. It is very important to keep the number of available actions to a minimum, because having too many options would defeat the purpose of the simplicity and efficiency it is trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== A user menu ===&lt;br /&gt;
&lt;br /&gt;
The new user menu would be a new renderer, called from the layout files as it was the case for the login info renderer. The content of the user menu is fixed and not configurable, however it is possible to override the renderer from a theme to change its layout and content.&lt;br /&gt;
&lt;br /&gt;
==== Design ====&lt;br /&gt;
&lt;br /&gt;
Placed on the top right of the site, the name of the user is displayed next to a user icon. The dropdown is displayed when the user clicks the icon or the name. On smaller screens only a user icon is displayed, and expands to reveal its content. When expanded the name of the user logged in is displayed.&lt;br /&gt;
&lt;br /&gt;
When the user is not logged in, a login link is displayed, regardless of the screen size.&lt;br /&gt;
&lt;br /&gt;
==== My grades ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My grades&#039; page will display the overall grades of the student in all their visible courses. The ordering can be changed, but the default would be alphabetical.&lt;br /&gt;
&lt;br /&gt;
==== Login as ====&lt;br /&gt;
&lt;br /&gt;
When logged in as someone else, the &#039;Logout&#039; entry becomes &#039;Return to Admin User&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Switch role ====&lt;br /&gt;
&lt;br /&gt;
When the user role is switched, the &#039;Logout&#039; entry becomes &#039;Return to my normal role&#039;. And the name of the user is appended with the role they switch to, e.g. &#039;Admin User (teacher)&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Trimming navigation ====&lt;br /&gt;
&lt;br /&gt;
At this stage we could trim the navigation block, but we decide not to remove anything just yet as it would create more confusion: some nodes would accessible from the user menu, and others from the navigation block.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
For it to be used, the user menu needs to be as short as possible and not being cluttered with additional links. It will contain what has been decided above, and not being changed. The users will get used to its content and thus removing nodes is a very tough decision to make. In any case, it should not contain more than 6 links, and should always contain:&lt;br /&gt;
&lt;br /&gt;
* My home&lt;br /&gt;
* My profile&lt;br /&gt;
* Preferences&lt;br /&gt;
* Logout&lt;br /&gt;
&lt;br /&gt;
The links in the menu are very important to the user, they target user context-specific pages and nothing related to the site structure or the course. A link to &#039;My courses&#039; would be redundant as this information should be covered in the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
=== A user preferences page ===&lt;br /&gt;
&lt;br /&gt;
The preferences page is a list of links to sub-preferences page. The page will be generated from the navigation node &#039;My profile settings&#039;, though we will have to re-organise them so that each link belongs to a parent node. A link to the preferences page is added to the user menu.&lt;br /&gt;
&lt;br /&gt;
==== Re-organisation ====&lt;br /&gt;
&lt;br /&gt;
* User account&lt;br /&gt;
** Edit profile&lt;br /&gt;
** Account settings&lt;br /&gt;
** Change password&lt;br /&gt;
** Security keys&lt;br /&gt;
** Messaging&lt;br /&gt;
&lt;br /&gt;
* Blogs&lt;br /&gt;
** Preferences&lt;br /&gt;
** External blogs&lt;br /&gt;
** Register an external blog&lt;br /&gt;
&lt;br /&gt;
* Badges&lt;br /&gt;
** Manage my badges&lt;br /&gt;
** Preferences&lt;br /&gt;
** Backpack settings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preferences page displays headings (the setting nodes) under which the links to the sub-pages will be displayed.&lt;br /&gt;
&lt;br /&gt;
[[File:userpreferences.png|frame|none|alt=User preferences page.|User preferences page.]&lt;br /&gt;
&lt;br /&gt;
The nodes &#039;Roles&#039; and &#039;Activity reports&#039; will not be part of this page, because they are context based: they point to the course or site context depending on the page we are on. They will remain in the navigation block, but only when the user has the capability to view them. When the only node in the &#039;My profile settings&#039; node is &#039;Preferences&#039;, then &#039;My profile settings&#039; is not displayed. Here is an example when you have the capability to view the reports and roles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblockpref.png|frame|none|alt=My profile settings node with extended capability.|My profile settings node with extended capability.]&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My profile settings&#039; node becomes the name of the user: &#039;Frédéric Massart&#039;. The &#039;Profile settings for Jetha Chan&#039; becomes &#039;Jetha Chan&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Breadcrumb ====&lt;br /&gt;
&lt;br /&gt;
Each of the sub-pages should be checked to ensure that they are in the right hierarchy, the breadcrumb always looks like &#039;(User context nav) &amp;gt; Preferences &amp;gt; Preference heading &amp;gt; Page I am on&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Another user&#039;s preferences ====&lt;br /&gt;
&lt;br /&gt;
The node &#039;Profile settings for User B&#039; can be used to edit someone&#039;s settings. The content is similar to &#039;My profile settings&#039;, except that the node will always be displayed regardless of the presence of &#039;Roles&#039; or &#039;Activity reports&#039;. Currently there is no other way for a user with elevated privileges to access someone&#039;s preferences, but sooner or later the preferences will be accessible from their profiles.&lt;br /&gt;
&lt;br /&gt;
[[File:navblocksomeonelse.png|frame|none|alt=Profile settings for X with extended capability.|Profile settings for X node with extended capability.]]&lt;br /&gt;
&lt;br /&gt;
==== Repositories ====&lt;br /&gt;
&lt;br /&gt;
Presently the repositories are configurable from the Navigation block, this is the right moment to move them to the &#039;Preferences&#039; page.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
Every link in this page should belong to a section, the sections are only headers that help the users finding what they are looking for. A plugin that adds user preferences related to its features should define a new heading and add its links to that heading. The heading is never clickable.&lt;br /&gt;
&lt;br /&gt;
=== A new profile page ===&lt;br /&gt;
&lt;br /&gt;
For now we will only be focussing on the site profile of the user. Later on, we will be solving the problems linked to the course context, for instances the links to &#039;Blog&#039; or &#039;Forum interactions&#039; automatically filtered to only display the blog posts in the course.&lt;br /&gt;
&lt;br /&gt;
==== Content ====&lt;br /&gt;
&lt;br /&gt;
The contact details will be displayed in such a way that they do not look like a list any more. For instance, everyone knows what an email address is, there is no need to prefix it with &#039;Email address:&#039;.&lt;br /&gt;
&lt;br /&gt;
The badges will be displayed on the profile too.&lt;br /&gt;
&lt;br /&gt;
==== Links ====&lt;br /&gt;
&lt;br /&gt;
* Edit profile (If this is your profile)&lt;br /&gt;
* Blog&lt;br /&gt;
* Forum interactions&lt;br /&gt;
* Notes (If you have the capability to)&lt;br /&gt;
* Preferences (If you have the capability to and are viewing someone&#039;s profile)&lt;br /&gt;
* Send a message&lt;br /&gt;
* Login as (If you have the capability to)&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can start trimming the node &#039;My profile&#039; a bit, but some nodes will remain until we sort out the &#039;My&#039; page. When doing so, it is important to make sure that the nodes &#039;Home &amp;gt; Some course &amp;gt; Participants &amp;gt; User B&#039; still contain everything it does right now, because those links point to course-based pages, and would not be accessible otherwise.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The profile page contains everything about the user that is public. In other words, a content specific to the user should not be displayed on the profile at all, because it would never be accessible to another user, e.g. &#039;Private files&#039;.&lt;br /&gt;
&lt;br /&gt;
There are exceptions to this rule, badges for example. As a setting allows you to define whether or not your badges are on your profile, you might not be able to see them there, so they should be available on your dashboard.&lt;br /&gt;
&lt;br /&gt;
For content controlled by permissions (and not preferences), they should remain on the profile. Take &#039;Blog&#039; as an example, an administrator can prevent blog entries from another user to be accessed depending on your role. As the user does not have any information about the roles of the other users, the blog link is displayed on the profile, but other users will not see it. Having a blog block on the &#039;My home&#039; page would not be useful because it simply duplicates the access points, for no apparent reason to the user.&lt;br /&gt;
&lt;br /&gt;
=== Revisiting &#039;My home&#039; page ===&lt;br /&gt;
&lt;br /&gt;
We need to add more default blocks to the existing page, the different available blocks will be:&lt;br /&gt;
&lt;br /&gt;
* My courses (already there)&lt;br /&gt;
* My private files (already there)&lt;br /&gt;
* The calendar&lt;br /&gt;
* Upcoming events&lt;br /&gt;
* My latest badges&lt;br /&gt;
&lt;br /&gt;
We need to add a link to &#039;My latest badges&#039; to the page listing all the badges.&lt;br /&gt;
&lt;br /&gt;
==== Navigation block ====&lt;br /&gt;
&lt;br /&gt;
We can now remove &#039;My profile&#039; (or now called &#039;Jetha Chan&#039;) from the navigation block entirely. But it has to still be accessible under the node of a user in a course tree.&lt;br /&gt;
&lt;br /&gt;
The node &#039;My courses&#039; is also removed, users should be used to using their dashboard to access their courses.&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
&lt;br /&gt;
The &#039;My home&#039; page contains everything about a user that is private and not accessible to other users. For instance, your calendar events or your private files. The list of courses you are enrolled in are an exception, they could be displayed on the user profile, but because they are so important and need to be layed out in useful fashion, they will be part of the &#039;My home&#039; page.&lt;br /&gt;
&lt;br /&gt;
This page does not need to link to pages which are already accessible from the &#039;User menu&#039;, for instance the profile.&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pending&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Handling of course profiles&lt;br /&gt;
* An administration page per module&lt;br /&gt;
* An administration page for the course&lt;br /&gt;
* Accessing course grades for students&lt;br /&gt;
* Dedicated solution to access reports&lt;br /&gt;
* Alternative site and course navigation&lt;br /&gt;
** Checking for inconsistencies in the breadcrumb jumping from one place to another.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
=== User context ===&lt;br /&gt;
&lt;br /&gt;
# The user menu&lt;br /&gt;
# Implementing the user &#039;header&#039; for user context pages&lt;br /&gt;
# The preferences page&lt;br /&gt;
# The new profile page&lt;br /&gt;
# Revisiting &#039;My home&#039;&lt;br /&gt;
&lt;br /&gt;
=== Course context ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;To be defined.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.google.com/document/d/16BJsINun13StUFOQaejj3Gawz9jk22ir_r49f3MbInM/edit#heading=h.fuvsbkikzj88 Navigation experiment]&lt;br /&gt;
* [https://docs.google.com/document/d/1AXJw8uX6MczA5VC3phkVVv1ee5eZ2nluIiPC2ecgHLE/edit#heading=h.k3lh9alzq3iy Navigation prototyping 2.7]&lt;br /&gt;
* MDL-34838: Navigation inconsistencies&lt;br /&gt;
* [http://demo2k12.moodlerooms.com Minimal by Moodlerooms]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226791 Users’ personalised profiles]&lt;/div&gt;</summary>
		<author><name>Jethac</name></author>
	</entry>
</feed>