<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/21/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tqr</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/21/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tqr"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/Special:Contributions/Tqr"/>
	<updated>2026-04-13T20:16:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Themes&amp;diff=85804</id>
		<title>Themes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Themes&amp;diff=85804"/>
		<updated>2011-07-08T21:46:32Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
&lt;br /&gt;
A Moodle theme is a pre-designed user &amp;quot;view&amp;quot; (interface) that can be changed by the site administrator, teacher, or student.  While robust, it does not affect how Moodle functions, just how it looks.  Moodle comes with a standard set of themes and there is a [http://moodle.org/mod/data/view.php?id=6552  large free library] available to download. &lt;br /&gt;
&lt;br /&gt;
==Moodle themes==&lt;br /&gt;
&lt;br /&gt;
Themes may be [[Theme settings|selected]] at site level, course level and/or user level as long as the Moodle site has been configured to allow changes at these levels.&lt;br /&gt;
&lt;br /&gt;
== Installing a theme ==&lt;br /&gt;
&lt;br /&gt;
To install a theme:&lt;br /&gt;
# Unzip the .zip file to an empty local directory.&lt;br /&gt;
# Upload folder to your web server to the /moodle/theme/[Theme Name]. (Replace [Theme Name] with the name of the theme you have downloaded.) Ensure the new theme folder and its contents are readable by the webserver.  Change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039; (version 1.7+) or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; (older versions).&lt;br /&gt;
&lt;br /&gt;
See [[Installing a new theme]] for more information.&lt;br /&gt;
&lt;br /&gt;
==Themes in standard install==&lt;br /&gt;
&lt;br /&gt;
Themes included in Moodle 1.9 are [[Chameleon theme|chameleon]], cornflower, [[Custom corners theme|custom corners]], formal white, metal, oceanblue, orangewhite, orangewhitepda, standard (default), standardblue, standardgreen, standardlogo, standardred, standardwhite, wood.  See [[Standard themes]] for screen shots of each.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://www.youtube.com/watch?v=pPUB_ReBPeg Installing 3rd Party Modules and Themes in Moodle video]&lt;br /&gt;
* [[Themes FAQ]]&lt;br /&gt;
* [[:dev:Theme_development|Theme development]]&lt;br /&gt;
* [[Development: Themes 2.0]]&lt;br /&gt;
&lt;br /&gt;
[[es:Temas]]&lt;br /&gt;
[[eu:Itxurak]]&lt;br /&gt;
[[de:Designs]]&lt;br /&gt;
[[fr:Thèmes]]&lt;br /&gt;
[[ja:テーマ]]&lt;br /&gt;
[[pt:Temas]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Themes&amp;diff=85803</id>
		<title>Themes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Themes&amp;diff=85803"/>
		<updated>2011-07-08T21:44:02Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
&lt;br /&gt;
A Moodle theme is a pre-designed user &amp;quot;view&amp;quot; (interface) that can be changed by the site administrator, teacher, or student.  While robust, it does not affect how Moodle functions, just how it looks.  Moodle comes with a standard set of themes and there is a [http://moodle.org/mod/data/view.php?id=6552  large free library] available to download. &lt;br /&gt;
&lt;br /&gt;
==Moodle themes==&lt;br /&gt;
&lt;br /&gt;
Themes may be [[Theme settings|selected]] at site level, course level and/or user level as long as the Moodle site has been configured to allow changes at these levels.&lt;br /&gt;
&lt;br /&gt;
== Installing a theme ==&lt;br /&gt;
&lt;br /&gt;
To install a theme:&lt;br /&gt;
# Unzip the .zip file to an empty local directory.&lt;br /&gt;
# Upload folder to your web server to the /moodle/theme/[Theme Name]. (Replace [Theme Name] with the name of the theme you have downloaded.) Ensure the new theme folder and its contents are readable by the webserver.  Change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039; (version 1.7+) or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; (older versions).&lt;br /&gt;
&lt;br /&gt;
See [[Installing a new theme]] for more information.&lt;br /&gt;
&lt;br /&gt;
==Themes in standard install==&lt;br /&gt;
&lt;br /&gt;
Themes included in Moodle 1.9 are [[Chameleon theme|chameleon]], cornflower, [[Custom corners theme|custom corners]], formal white, metal, oceanblue, orangewhite, orangewhitepda, standard (default), standardblue, standardgreen, standardlogo, standardred, standardwhite, wood.  See [[Standard themes]] for screen shots of each.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://www.youtube.com/watch?v=pPUB_ReBPeg Installing 3rd Party Modules and Themes in Moodle video]&lt;br /&gt;
* [[Themes FAQ]]&lt;br /&gt;
* [[:dev:Theme_development|Theme development]]&lt;br /&gt;
* [[Themes 2.0]]&lt;br /&gt;
&lt;br /&gt;
[[es:Temas]]&lt;br /&gt;
[[eu:Itxurak]]&lt;br /&gt;
[[de:Designs]]&lt;br /&gt;
[[fr:Thèmes]]&lt;br /&gt;
[[ja:テーマ]]&lt;br /&gt;
[[pt:Temas]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Creating_a_custom_theme&amp;diff=85478</id>
		<title>Creating a custom theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Creating_a_custom_theme&amp;diff=85478"/>
		<updated>2011-06-24T10:35:14Z</updated>

		<summary type="html">&lt;p&gt;Tqr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Please refer to [[TOC_with_notes#Themes|these notes]] before editing this page.&#039;&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;This Article refers to Moodle 1.9 and needs updating to Moodle 2.0&#039;&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;theme&#039;&#039;&#039; is what defines the way the Moodle engine displays all of your Moodle powered pages. Themes are easy to create and allow you to personalize Moodle for your class, school, or school district. Themes consist of a Cascading Style Sheet (CSS) file and a few images. The simplest way to create a custom theme for your school is to modify the CSS and images of an existing theme. This tutorial will walk you through creating a custom theme based on the default Moodle theme which comes with version 1.9 of Moodle. Note that some additional color schemes are already included, and one of those may already fit your needs; be sure to check.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
In order to edit your theme, you&#039;ll need to have all of the following:&lt;br /&gt;
*An installation of Moodle 1.9 or greater&lt;br /&gt;
*Access to the server where Moodle is hosted (talk to your network administrator)&lt;br /&gt;
*(If your access is over FTP or SSH) A transfer program, such as the free program [http://filezilla-project.org/ FileZilla]&lt;br /&gt;
*A text editor (Windows comes with one by default, but others like [http://notepad-plus.sourceforge.net/ Notepad++] or [http://barebones.com/products/textwrangler/ TextWrangler] (Mac) make editing much easier)&lt;br /&gt;
&lt;br /&gt;
==Get your new Theme setup==&lt;br /&gt;
&lt;br /&gt;
First, login to your Moodle server, and navigate to the &amp;quot;/theme&amp;quot; directory inside the main Moodle directory. Copy the folder named &amp;quot;/standard&amp;quot; to an appropriate name for your new theme (avoid spaces or capital letters, e.g. &amp;quot;schoolname&amp;quot;). This will appear as the name of your theme inside the Moodle configuration.&lt;br /&gt;
&lt;br /&gt;
If you do not have direct access to the server (e.g. you are working from your own computer) use your file transfer program to download a copy of this folder to your desktop and rename it there.&lt;br /&gt;
&lt;br /&gt;
==Start from scratch or use a parent theme?==&lt;br /&gt;
&lt;br /&gt;
You can now start to alter the features of the theme you have just copied, or choose to set it to use another theme as the parent, in which case your theme will use the parent theme&#039;s styles as a base, plus any changes you make. This is better than copying the entire folder of that theme and changing it, as sometimes the developers will make changes to the original theme to keep up with new Moodle features. These changes will not be included if you take the whole folder and alter it, but using another theme as a parent means that that original theme will be unchanged and will be updated when you update the rest of Moodle, avoiding messy surprises.&lt;br /&gt;
&lt;br /&gt;
Use code like this in &#039;&#039;&#039;/theme/yourtheme/config.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&#039;user_styles&#039;);&lt;br /&gt;
$THEME-&amp;gt;standardsheets = array(&#039;styles_layout&#039;);&lt;br /&gt;
$THEME-&amp;gt;parent = &#039;custom_corners&#039;;  // put the name of the theme folder you want to use as parent here. &lt;br /&gt;
$THEME-&amp;gt;parentsheets = array(&#039;user_styles&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you then lose all .css files except &#039;&#039;&#039;user_styles.css&#039;&#039;&#039;, which should be empty, where you start to add CSS as described below.&lt;br /&gt;
&lt;br /&gt;
==Get your colors==&lt;br /&gt;
In order to configure your theme, you&#039;ll need to know what colors you want to use. You should make a note of which colors you want to use, a full list of universally supported colors is available at [http://www.w3schools.com/css/css_colornames.asp]. Keep in mind that CSS is an exact language - &#039;&#039;DarkGrey&#039;&#039; will work while &#039;&#039;Dark Grey&#039;&#039; will not.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a diagram what you&#039;ll need to choose colors for:&lt;br /&gt;
[[Image:Basic_CSS_Property_Diagram.gif|frame|center|Diagram of the Moodle CSS properties.]]&lt;br /&gt;
&lt;br /&gt;
Best practices for choosing a color scheme is to make your background a light color, your text a dark color, and your link colors something in-between the two. No two colors should ever be the same or a near match. You should also avoid high-contrast colors such as a red background with blue text, which can be incredibly hard to read.&lt;br /&gt;
&lt;br /&gt;
==Style the new theme==&lt;br /&gt;
Now that you have copied the default theme, and chosen the colors for your new theme, it&#039;s time to start styling the new page. Open up the &#039;styles_color.css&#039; file inside the folder you created in the first step inside your text editor. If you wish to use the editor built into Windows, you may access this program by visiting &#039;&#039;&#039;Start &amp;gt; All Programs &amp;gt; Accessories &amp;gt; Notepad&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The following will need to be updated inside of the opened file.&lt;br /&gt;
&lt;br /&gt;
===The Regular Link color===&lt;br /&gt;
Near the top of the file you will see a line which says &#039;&#039;a:visited {&#039;&#039;. On the next line you should find the text &#039;&#039;&amp;lt;nowiki&amp;gt;color:#0000FF;&amp;lt;/nowiki&amp;gt;&#039;&#039;. Erase everything after the colon, but before the semi-colon and replace it with the name of your new link color. The line should now appear as &#039;&#039;&amp;lt;nowiki&amp;gt;color:&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;YourNewColor&#039;&#039;&#039;;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===The Hovered Link color===&lt;br /&gt;
Eight lines down from where you made your last change you will see a line which reads &#039;&#039;a:hover {&#039;&#039;. You&#039;ll also see &#039;&#039;color:#FF0000;&#039;&#039; on the next line. Like in the last step, change everything after the colon and before the semi-colon to your new color.&lt;br /&gt;
&lt;br /&gt;
===The Page Background color===&lt;br /&gt;
Scroll to where you see a line which says &#039;&#039;&amp;lt;nowiki&amp;gt;body {&amp;lt;/nowiki&amp;gt;&#039;&#039;. On the next line you should find the text &#039;&#039;&amp;lt;nowiki&amp;gt;background-color:#FAFAFA;&amp;lt;/nowiki&amp;gt;&#039;&#039;. Erase everything after the colon, but before the semi-colon and replace it with the name of your new background color. The line should now appear as &#039;&#039;&amp;lt;nowiki&amp;gt;background-color:&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;red&#039;&#039;&#039;;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now look for the line which reads &#039;&#039;.sideblock .content {&#039;&#039; about 1/3 of the way down the page. Two lines below it is a line which reads &#039;&#039;background-color:#ff0000;&#039;&#039;. Change everything after the colon and before the semi-colon to the same background color. If you want the sidebar boxes to stand out more, you may wish to change this color to something of the same color, but lighter.&lt;br /&gt;
&lt;br /&gt;
===The Text color===&lt;br /&gt;
On the line below where you changed your last value you will find the regular font color. As with the previous step, replace the &#039;&#039;#000&#039;&#039; with your new color. The line should now read &#039;&#039;&amp;lt;nowiki&amp;gt;color:&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;YourNewColor&#039;&#039;&#039;;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remember that while it may be appealing to you to use one of your school colors as the text color, it will probably make it hard for students to read. If you&#039;re going to change this from the default black you should chose a very dark shade to replace it with.&lt;br /&gt;
&lt;br /&gt;
At this point you should save this file and close it.&lt;br /&gt;
&lt;br /&gt;
==Advanced theming==&lt;br /&gt;
&lt;br /&gt;
The hardest part is knowing what CSS to change in order to alter the appearance of a particular element.&lt;br /&gt;
&lt;br /&gt;
Install [http://www.mozilla-europe.org/en/products/firefox/ Firefox], with the [https://addons.mozilla.org/en-US/firefox/addon/60 Web Developer Toolbar]. You can now press Shift + CTRL-Y and click something on the page to see what CSS rules apply to it. By putting the same rules into you user_styles.css file with new values, you can change the appearance of that element. CTRL-F will give you information about an elements other properties like ancestors and children.&lt;br /&gt;
&lt;br /&gt;
An even more powerful Firefox add-on is [http://getfirebug.com/ Firebug]. Please see [[Development:Firebug]] for more information.&lt;br /&gt;
&lt;br /&gt;
==Adding a Logo==&lt;br /&gt;
To add a logo to your page, you&#039;ll need to get your current logo in a GIF format with a height of no larger than 100 px. If someone from your organization is able to provide this, skip the next section. If not, the following will help you to resize your logo.&lt;br /&gt;
&lt;br /&gt;
===Resizing Your Logo===&lt;br /&gt;
Your logo needs to be in a GIF format with a height of no more than 100 pixels. The simplest way to create this file is to use the web service located at [http://www.picresize.com]. Upload your original logo using the upload field and choose Continue. Scroll to Step 2. In the field labelled &#039;&#039;Height (Optional)&#039;&#039; input &#039;&#039;&#039;100&#039;&#039;&#039; and chose &#039;&#039;Pixels&#039;&#039; from the drop-down box to the right of it. Scroll to the bottom of the page and change the select box labelled &#039;&#039;Save As&#039;&#039; to read &#039;&#039;GIF&#039;&#039;. Choose &#039;&#039;Resize Pic!&#039;&#039;. Save the result to your hard drive.&lt;br /&gt;
&lt;br /&gt;
===Copying the Logo===&lt;br /&gt;
Copy the 100px logo into the &amp;quot;pix&amp;quot; folder inside your theme folder. Rename it to &#039;&#039;logo.gif&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Adding the Logo===&lt;br /&gt;
Back in the main folder for your theme open the file named &amp;quot;header.html&amp;quot; inside of your text editor. You will now need to look for the first ocurrance of the following: &#039;&#039;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&#039;&#039;[[Image:Adding_Logo.gif|frame|right|Your logo will appear in this location.]] Immediately after this code, add the following (assuming you followed the exact instructions for copying and renaming your logo): &#039;&#039;&amp;lt;nowiki&amp;gt;&amp;amp;lt;img src=&amp;quot;&amp;amp;lt;?php echo $CFG-&amp;gt;themewww .&#039;/&#039;. current_theme() ?&amp;amp;gt;/pix/logo.gif&amp;quot; alt=&amp;quot;&amp;quot; /&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&#039;&#039;&lt;br /&gt;
This will place a logo on the front school page. If you want a logo on all pages, including teacher pages, repeat this step for the second ocurrance of &#039;&#039;&amp;lt;nowiki&amp;gt;&amp;amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;amp;gt;&amp;lt;/nowiki&amp;gt;&#039;&#039; as well.&lt;br /&gt;
&lt;br /&gt;
==Theme Display Information==&lt;br /&gt;
&lt;br /&gt;
Your theme needs a unique name, otherwise it may not appear in the theme selector. Inside your theme&#039;s directory, go into lang/ and then into the directory for your language (for English, go into en/). In each of those directories is a file that should be called theme_THEMENAME.php (for example, if your theme is called &amp;quot;squiddles,&amp;quot; the file would be theme_squiddles.php). If THEMENAME isn&#039;t your theme&#039;s name, rename the file so it is.&lt;br /&gt;
&lt;br /&gt;
Next, open the file. You&#039;ll see that it sets several variables related to naming and displaying your theme. The most important is $string[&#039;pluginname&#039;]. Set this to the name you want your theme to display when a moodle user is selecting themes. It doesn&#039;t have to be the same as the theme name in the name of the file (for example, you might call your theme &amp;quot;squiddles&amp;quot; internally, but you could set $string[&#039;pluginname&#039;] to &amp;quot;A Squiddles Oceanparty Jamboree&amp;quot;). You can also set the preview image your theme will use in the theme selector.&lt;br /&gt;
&lt;br /&gt;
==Finished==&lt;br /&gt;
If you used a file transfer program to copy the entire folder as detailed in Step One, you should copy the entire folder back into the &amp;quot;theme&amp;quot; folder of your Moodle server. Additionally, change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute. (In most file transfer programs you can right-click on the folder and choose Properties to do this. In some cases you may need to ask your server administrator to do this for you.)&lt;br /&gt;
&lt;br /&gt;
You can now use your Administrator panel to change your site to the new theme. Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cusomized_Theme.gif|frame|center|Your new theme!]]&lt;br /&gt;
&lt;br /&gt;
Because of the thousands of HTML elements in Moodle it&#039;s impossible to account for every possible change you may want to make to your theme. If you are interested in making more advanced changes, it&#039;s recommended you download the [http://www.getfirefox.com Firefox] web browser and install the [http://www.getfirebug.com/ Firebug] addon to see the HTML structure of Moodle pages. If you do not know CSS, the  [http://www.w3schools.com/css/default.asp CSS Page] on W3Schools may be a good starting point.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Make your own theme]]&lt;br /&gt;
* [[Theme config file]]&lt;br /&gt;
* [[Themes FAQ]]&lt;br /&gt;
* [[CSS FAQ]]&lt;br /&gt;
* [[Custom corners theme]]&lt;br /&gt;
* [[Chameleon theme]]&lt;br /&gt;
* [[Development:Firebug]]&lt;br /&gt;
* [https://docs.moodle.org/en/Category:Firefox_extensions Category:Firefox_extensions]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82838</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82838"/>
		<updated>2011-04-18T08:16:27Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in a theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, which is written in XHTML and is the contents of the page that you will see when selecting &#039;&#039;&#039;Foxxie&#039;&#039;&#039; in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;Boxxie&#039; to &#039;Foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, like renderers, lib and settings PHP as well as Javascript, jQuery and other customisable elements of a Moodle theme.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 creating your first theme]] - A quick step by step guide to creating your first theme.&lt;br /&gt;
* [[Development:Themes 2.0 overriding a renderer]] - A tutorial on creating a custom renderer and changing the HTML Moodle produces.&lt;br /&gt;
* [[Development:Themes 2.0 How to use images within your theme]] - Explains how to use and override images within your theme.&lt;br /&gt;
* [[Development:Themes 2.0 adding a settings page]] - Looks at how to add a setting page making your theme easily customisable.&lt;br /&gt;
* [[Development:Themes 2.0 extending the custom menu]] - Customising the custom menu.&lt;br /&gt;
* [[Development:Themes 2.0 how to make the dock horizontal]] - Modifying the dock to make it horizontal.&lt;br /&gt;
* [[Development:Styling and customising the dock]] - How to style and customise the dock.&lt;br /&gt;
* [[Development:Themes 2.0 adding upgrade code]]&lt;br /&gt;
* [[Development:Theme changes in 2.0]]&lt;br /&gt;
* [[Development:Using jQuery with Moodle 2.0]]&lt;br /&gt;
* [http://www.youtube.com/watch?v=OvaU54uh-qA New themes in Moodle 2.0 video]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82837</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82837"/>
		<updated>2011-04-18T08:14:09Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in a theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, which is written in XHTML and is the contents of the page that you will see when selecting &#039;&#039;&#039;Foxxie&#039;&#039;&#039; in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;Boxxie&#039; to &#039;Foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, like renderers, lib and settings PHP as well as Javascript, jQuery and other customisable elements of a Moodle theme.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 creating your first theme]] - A quick step by step guide to creating your first theme.&lt;br /&gt;
* [[Development:Themes 2.0 overriding a renderer]] - A tutorial on creating a custom renderer and changing the HTML Moodle produces.&lt;br /&gt;
* [[Development:Themes 2.0 how to use images within your theme]] - Explains how to use and override images within your theme.&lt;br /&gt;
* [[Development:Themes 2.0 adding a settings page]] - Looks at how to add a setting page making your theme easily customisable.&lt;br /&gt;
* [[Development:Themes 2.0 extending the custom menu]] - Customising the custom menu.&lt;br /&gt;
* [[Development:Themes 2.0 how to make the dock horizontal]] - Modifying the dock to make it horizontal.&lt;br /&gt;
* [[Development:Styling and customising the dock]] - How to style and customise the dock.&lt;br /&gt;
* [[Development:Themes 2.0 adding upgrade code]]&lt;br /&gt;
* [[Development:Theme changes in 2.0]]&lt;br /&gt;
* [[Development:Using jQuery with Moodle 2.0]]&lt;br /&gt;
* [http://www.youtube.com/watch?v=OvaU54uh-qA New themes in Moodle 2.0 video]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82836</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82836"/>
		<updated>2011-04-18T08:08:01Z</updated>

		<summary type="html">&lt;p&gt;Tqr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in a theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, which is written in XHTML and is the contents of the page that you will see when selecting &#039;&#039;&#039;Foxxie&#039;&#039;&#039; in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;Boxxie&#039; to &#039;Foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, like renderers, lib and settings PHP as well as Javascript, jQuery and other customisable elements of a Moodle theme.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development: Theme changes in 2.0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82824</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82824"/>
		<updated>2011-04-17T07:35:42Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, the part that you see when selecting this theme in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development: Theme changes in 2.0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82823</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82823"/>
		<updated>2011-04-17T07:35:03Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, the part that you see when selecting this theme in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development: Themes changes in 2.0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82822</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82822"/>
		<updated>2011-04-17T07:33:05Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, the part that you see when selecting this theme in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development: Themes changes in Moodle 2]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82821</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82821"/>
		<updated>2011-04-17T07:31:17Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, the part that you see when selecting this theme in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82820</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82820"/>
		<updated>2011-04-17T07:30:33Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Language Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, the part that you see when selecting this theme in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82819</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82819"/>
		<updated>2011-04-17T07:25:04Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this first section above, the only thing you need to change here is the word &#039;&#039;&#039;boxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, the part that you see when selecting this theme in the Theme Selector. However, you are advised to read what is already written there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82818</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82818"/>
		<updated>2011-04-17T07:16:18Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Language Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this first section above, the only thing you need to change here is the word &#039;&#039;&#039;boxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, the part that you see when selecting this theme in the Theme Selector. However, you are advised to read what is already written there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82817</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82817"/>
		<updated>2011-04-17T07:12:17Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Language Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this first section above, the only thing you need to change here is the works &#039;&#039;&#039;boxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, the part that is what you see when selecting this theme In  the Theme Selector, however, you need to read what is there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on the lines that are written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82816</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82816"/>
		<updated>2011-04-17T07:05:40Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Language Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this first section above, the only thing you need to change here is the works &#039;&#039;&#039;boxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039; however, you need to read what is there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit youself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give due credit, where credit is due, to the original theme designer in the &#039;&#039;&#039;credits&#039;&#039;&#039; section by stating something on the lines that, &#039;&#039;&#039;&#039;&#039;Foxxie is a customised Moodle theme based on the original Boxxie theme by Patrick Malley.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;&amp;lt;div class=&amp;quot;clearfix&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;theme_screenshot&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Boxxie&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;boxxie/pix/screenshot.jpg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Discussion Forum:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://moodle.org/mod/forum/view.php?id=46&amp;quot;&amp;gt;&lt;br /&gt;
http://moodle.org/mod/forum/view.php?id=46&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Credits&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme_credits&amp;quot;&amp;gt;&lt;br /&gt;
https://docs.moodle.org/en/Theme_credits&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Documentation:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Themes&amp;quot;&amp;gt;&lt;br /&gt;
https://docs.moodle.org/en/Themes&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Report a bug:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://tracker.moodle.org&amp;quot;&amp;gt;&lt;br /&gt;
http://tracker.moodle.org&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;theme_description&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Boxxie is a fluid-width, three-column theme for Moodle 2.0.&lt;br /&gt;
&amp;lt;h2&amp;gt;Tweaks&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. &lt;br /&gt;
If you want to modify this theme, we recommend that you first duplicate it then rename it before making your changes.&lt;br /&gt;
This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\&#039;ll still have the original files if you make a mess. &lt;br /&gt;
More information on modifying themes can be found in the &amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme&amp;quot;&amp;gt;MoodleDocs&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Credits&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This theme was coded and is maintained by Patrick Malley. He can be contacted by email at contact@newschoollearning.com. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;License&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This, and all other themes included in the Moodle core, are licensed under the &amp;lt;a href=&amp;quot;http://www.gnu.org/licenses/gpl.html&amp;quot;&amp;gt;GNU General Public License&amp;lt;/a&amp;gt;.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82815</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82815"/>
		<updated>2011-04-17T07:03:59Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Language Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this first section above, the only thing you need to change here is the works &#039;&#039;&#039;boxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039; however, you need to read what is there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit youself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give due credit, where credit is due, to the original theme designer in the &#039;&#039;&#039;credits&#039;&#039;&#039; section by stating something on the lines that, &#039;&#039;&#039;&#039;&#039;Foxxie is a customised Moodle theme based on the original Boxxie theme by Patrick Malley.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;&amp;lt;div class=&amp;quot;clearfix&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;theme_screenshot&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Boxxie&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;boxxie/pix/screenshot.jpg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Discussion Forum:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://moodle.org/mod/forum/view.php?id=46&amp;quot;&amp;gt;&lt;br /&gt;
http://moodle.org/mod/forum/view.php?id=46&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Credits&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme_credits&amp;quot;&amp;gt;&lt;br /&gt;
https://docs.moodle.org/en/Theme_credits&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Documentation:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Themes&amp;quot;&amp;gt;&lt;br /&gt;
https://docs.moodle.org/en/Themes&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Report a bug:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://tracker.moodle.org&amp;quot;&amp;gt;&lt;br /&gt;
http://tracker.moodle.org&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;theme_description&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Boxxie is a fluid-width, three-column theme for Moodle 2.0.&lt;br /&gt;
&amp;lt;h2&amp;gt;Tweaks&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\&#039;ll still have the original files if you make a mess. More information on modifying themes can be found in the &amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme&amp;quot;&amp;gt;MoodleDocs&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Credits&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This theme was coded and is maintained by Patrick Malley. He can be contacted by email at contact@newschoollearning.com. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;License&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This, and all other themes included in the Moodle core, are licensed under the &amp;lt;a href=&amp;quot;http://www.gnu.org/licenses/gpl.html&amp;quot;&amp;gt;GNU General Public License&amp;lt;/a&amp;gt;.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82814</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82814"/>
		<updated>2011-04-17T07:02:21Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Language Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this first section above, the only thing you need to change here is the works &#039;&#039;&#039;boxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039; however, you need to read what is there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit youself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give due credit, where credit is due, to the original theme designer in the &#039;&#039;&#039;credits&#039;&#039;&#039; section by stating something on the lines that, &#039;&#039;&#039;&#039;&#039;Foxxie is a customised Moodle theme based on the original Boxxie theme by Patrick Malley.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;&amp;lt;div class=&amp;quot;clearfix&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;theme_screenshot&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Boxxie&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;boxxie/pix/screenshot.jpg&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Discussion Forum:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://moodle.org/mod/forum/view.php?id=46&amp;quot;&amp;gt;http://moodle.org/mod/forum/view.php?id=46&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Credits&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme_credits&amp;quot;&amp;gt;https://docs.moodle.org/en/Theme_credits&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Theme Documentation:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Themes&amp;quot;&amp;gt;https://docs.moodle.org/en/Themes&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Report a bug:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://tracker.moodle.org&amp;quot;&amp;gt;http://tracker.moodle.org&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;theme_description&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Boxxie is a fluid-width, three-column theme for Moodle 2.0.&lt;br /&gt;
&amp;lt;h2&amp;gt;Tweaks&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\&#039;ll still have the original files if you make a mess. More information on modifying themes can be found in the &amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme&amp;quot;&amp;gt;MoodleDocs&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Credits&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This theme was coded and is maintained by Patrick Malley. He can be contacted by email at contact@newschoollearning.com. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;License&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This, and all other themes included in the Moodle core, are licensed under the &amp;lt;a href=&amp;quot;http://www.gnu.org/licenses/gpl.html&amp;quot;&amp;gt;GNU General Public License&amp;lt;/a&amp;gt;.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82813</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82813"/>
		<updated>2011-04-17T06:58:53Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Language Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference to to &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in this theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this first section above, the only thing you need to change here is the works &#039;&#039;&#039;boxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039; however, you need to read what is there and change it accordingly, renaming &#039;boxxie&#039; to &#039;foxxie&#039;, and changing the contents of this part to suit youself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give due credit, where credit is due, to the original theme designer in the &#039;&#039;&#039;credits&#039;&#039;&#039; section by stating something on the lines that, &#039;&#039;&#039;&#039;&#039;Foxxie is a customised Moodle theme based on the original Boxxie theme by Patrick Malley.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;&amp;lt;div class=&amp;quot;clearfix&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;theme_screenshot&amp;quot;&amp;gt;&amp;lt;h2&amp;gt;Boxxie&amp;lt;/h2&amp;gt;&amp;lt;img src=&amp;quot;boxxie/pix/screenshot.jpg&amp;quot; /&amp;gt;&amp;lt;h3&amp;gt;Theme Discussion Forum:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://moodle.org/mod/forum/view.php?id=46&amp;quot;&amp;gt;http://moodle.org/mod/forum/view.php?id=46&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Theme Credits&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme_credits&amp;quot;&amp;gt;https://docs.moodle.org/en/Theme_credits&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Theme Documentation:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Themes&amp;quot;&amp;gt;https://docs.moodle.org/en/Themes&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Report a bug:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://tracker.moodle.org&amp;quot;&amp;gt;http://tracker.moodle.org&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;theme_description&amp;quot;&amp;gt;&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;Boxxie is a fluid-width, three-column theme for Moodle 2.0.&amp;lt;h2&amp;gt;Tweaks&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\&#039;ll still have the original files if you make a mess. More information on modifying themes can be found in the &amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme&amp;quot;&amp;gt;MoodleDocs&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;h2&amp;gt;Credits&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This theme was coded and is maintained by Patrick Malley. He can be contacted by email at contact@newschoollearning.com. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;License&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;This, and all other themes included in the Moodle core, are licensed under the &amp;lt;a href=&amp;quot;http://www.gnu.org/licenses/gpl.html&amp;quot;&amp;gt;GNU General Public License&amp;lt;/a&amp;gt;.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And basically that&#039;s it as far as this theme is concerned. However there are some themes which contain far more files and directories, so be sure to check those thoroughly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82812</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82812"/>
		<updated>2011-04-17T06:28:27Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Language Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open theme_foxxie.php you will see lots of language $strings (&#039;&#039;see below&#039;&#039;) which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;&amp;lt;div class=&amp;quot;clearfix&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;theme_screenshot&amp;quot;&amp;gt;&amp;lt;h2&amp;gt;Boxxie&amp;lt;/h2&amp;gt;&amp;lt;img src=&amp;quot;boxxie/pix/screenshot.jpg&amp;quot; /&amp;gt;&amp;lt;h3&amp;gt;Theme Discussion Forum:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://moodle.org/mod/forum/view.php?id=46&amp;quot;&amp;gt;http://moodle.org/mod/forum/view.php?id=46&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Theme Credits&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme_credits&amp;quot;&amp;gt;https://docs.moodle.org/en/Theme_credits&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Theme Documentation:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Themes&amp;quot;&amp;gt;https://docs.moodle.org/en/Themes&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Report a bug:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://tracker.moodle.org&amp;quot;&amp;gt;http://tracker.moodle.org&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;theme_description&amp;quot;&amp;gt;&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;Boxxie is a fluid-width, three-column theme for Moodle 2.0.&amp;lt;h2&amp;gt;Tweaks&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\&#039;ll still have the original files if you make a mess. More information on modifying themes can be found in the &amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme&amp;quot;&amp;gt;MoodleDocs&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;h2&amp;gt;Credits&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This theme was coded and is maintained by Patrick Malley. He can be contacted by email at contact@newschoollearning.com. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;License&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;This, and all other themes included in the Moodle core, are licensed under the &amp;lt;a href=&amp;quot;http://www.gnu.org/licenses/gpl.html&amp;quot;&amp;gt;GNU General Public License&amp;lt;/a&amp;gt;.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82811</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82811"/>
		<updated>2011-04-17T06:25:54Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
== Language Strings ==&lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of language $strings (&#039;&#039;see below&#039;&#039;) which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;&amp;lt;div class=&amp;quot;clearfix&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;theme_screenshot&amp;quot;&amp;gt;&amp;lt;h2&amp;gt;Boxxie&amp;lt;/h2&amp;gt;&amp;lt;img src=&amp;quot;boxxie/pix/screenshot.jpg&amp;quot; /&amp;gt;&amp;lt;h3&amp;gt;Theme Discussion Forum:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://moodle.org/mod/forum/view.php?id=46&amp;quot;&amp;gt;http://moodle.org/mod/forum/view.php?id=46&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Theme Credits&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme_credits&amp;quot;&amp;gt;https://docs.moodle.org/en/Theme_credits&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Theme Documentation:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Themes&amp;quot;&amp;gt;https://docs.moodle.org/en/Themes&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Report a bug:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://tracker.moodle.org&amp;quot;&amp;gt;http://tracker.moodle.org&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;theme_description&amp;quot;&amp;gt;&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;Boxxie is a fluid-width, three-column theme for Moodle 2.0.&amp;lt;h2&amp;gt;Tweaks&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\&#039;ll still have the original files if you make a mess. More information on modifying themes can be found in the &amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme&amp;quot;&amp;gt;MoodleDocs&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;h2&amp;gt;Credits&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This theme was coded and is maintained by Patrick Malley. He can be contacted by email at contact@newschoollearning.com. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;License&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;This, and all other themes included in the Moodle core, are licensed under the &amp;lt;a href=&amp;quot;http://www.gnu.org/licenses/gpl.html&amp;quot;&amp;gt;GNU General Public License&amp;lt;/a&amp;gt;.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82810</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82810"/>
		<updated>2011-04-17T06:22:45Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
== Language Strings ==&lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of language $strings (&#039;&#039;see below&#039;&#039;) which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;&amp;lt;div class=&amp;quot;clearfix&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;theme_screenshot&amp;quot;&amp;gt;&amp;lt;h2&amp;gt;Boxxie&amp;lt;/h2&amp;gt;&amp;lt;img src=&amp;quot;boxxie/pix/screenshot.jpg&amp;quot; /&amp;gt;&amp;lt;h3&amp;gt;Theme Discussion Forum:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://moodle.org/mod/forum/view.php?id=46&amp;quot;&amp;gt;http://moodle.org/mod/forum/view.php?id=46&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Theme Credits&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme_credits&amp;quot;&amp;gt;https://docs.moodle.org/en/Theme_credits&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Theme Documentation:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Themes&amp;quot;&amp;gt;https://docs.moodle.org/en/Themes&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Report a bug:&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://tracker.moodle.org&amp;quot;&amp;gt;http://tracker.moodle.org&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;theme_description&amp;quot;&amp;gt;&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;Boxxie is a fluid-width, three-column theme for Moodle 2.0.&amp;lt;h2&amp;gt;Tweaks&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\&#039;ll still have the original files if you make a mess. More information on modifying themes can be found in the &amp;lt;a href=&amp;quot;https://docs.moodle.org/en/Theme&amp;quot;&amp;gt;MoodleDocs&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;h2&amp;gt;Credits&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This theme was coded and is maintained by Patrick Malley. He can be contacted by email at contact@newschoollearning.com. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;License&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;This, and all other themes included in the Moodle core, are licensed under the &amp;lt;a href=&amp;quot;http://www.gnu.org/licenses/gpl.html&amp;quot;&amp;gt;GNU General Public License&amp;lt;/a&amp;gt;.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82809</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82809"/>
		<updated>2011-04-17T06:11:32Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings (&#039;&#039;see below&#039;&#039;) which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#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;] =&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82808</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82808"/>
		<updated>2011-04-17T06:07:43Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82807</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82807"/>
		<updated>2011-04-17T06:05:29Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; represent Italian). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82806</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82806"/>
		<updated>2011-04-17T06:03:49Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case&#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; represent Italian). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82805</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82805"/>
		<updated>2011-04-17T06:02:46Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Getting started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;copy&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case&#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; represent Italian). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82804</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82804"/>
		<updated>2011-04-17T06:00:49Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;Boxxie&#039;&#039;, which is one of several Moodle &#039;&#039;core&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;theme&#039;&#039; directory &#039;&#039;right click&#039;&#039; on &#039;&#039;boxxie&#039;&#039; and then &#039;&#039;copy&#039;&#039; and  &#039;&#039;paste&#039;&#039; back into your Moodle &#039;&#039;theme&#039;&#039; directory. You should now have a folder called &#039;&#039;Copy of boxxie&#039;&#039;. If you &#039;&#039;right click&#039;&#039; this folder you are given the option to &#039;&#039;Rename&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;foxxie&#039;&#039; (or to whatever name you want to call your &#039;&#039;cloned&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;foxxie&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;lang/en/&#039;&#039; contain a file &#039;&#039;theme_boxxie.php&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;foxxie&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case&#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; represent Italian). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82803</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82803"/>
		<updated>2011-04-17T05:58:39Z</updated>

		<summary type="html">&lt;p&gt;Tqr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;Boxxie&#039;&#039;, which is one of several Moodle &#039;&#039;core&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;theme&#039;&#039; directory &#039;&#039;right click&#039;&#039; on &#039;&#039;boxxie&#039;&#039; and then &#039;&#039;copy&#039;&#039; and  &#039;&#039;paste&#039;&#039; back into your Moodle &#039;&#039;theme&#039;&#039; directory. You should now have a folder called &#039;&#039;Copy of boxxie&#039;&#039;. If you &#039;&#039;right click&#039;&#039; this folder you are given the option to &#039;&#039;Rename&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;foxxie&#039;&#039; (or to whatever name you want to call your &#039;&#039;cloned&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;foxxie&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;lang/en/&#039;&#039; contain a file &#039;&#039;theme_boxxie.php&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;foxxie&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;cloning&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;boxxie&#039;&#039;, occurs. The first place to look, as mentioned above, is lang/en/theme_boxxie.php. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;right click&#039;&#039; on this file and &#039;&#039;rename&#039;&#039; it &#039;&#039;theme_foxxie.php&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; represent Italian). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82802</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82802"/>
		<updated>2011-04-17T05:52:49Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;Boxxie&#039;&#039;, which is one of several Moodle &#039;&#039;core&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;theme&#039;&#039; directory &#039;&#039;right click&#039;&#039; on &#039;&#039;boxxie&#039;&#039; and then &#039;&#039;copy&#039;&#039; and  &#039;&#039;paste&#039;&#039; back into your Moodle &#039;&#039;theme&#039;&#039; directory. You should now have a folder called &#039;&#039;Copy of boxxie&#039;&#039;. If you &#039;&#039;right click&#039;&#039; this folder you are given the option to &#039;&#039;Rename&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;foxxie&#039;&#039; (or to whatever name you want to call your &#039;&#039;cloned&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;foxxie&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;lang/en/&#039;&#039; contain a file &#039;&#039;theme_boxxie.php&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;foxxie&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;cloning&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;boxxie&#039;&#039;, occurs. The first place to look, as mentioned above, is lang/en/theme_boxxie.php. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;right click&#039;&#039; on this file and &#039;&#039;rename&#039;&#039; it &#039;&#039;theme_foxxie.php&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; represent Italian). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82801</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82801"/>
		<updated>2011-04-17T05:46:51Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Re-naming some elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;Boxxie&#039;&#039;, which is one of several Moodle &#039;&#039;core&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;theme&#039;&#039; directory &#039;&#039;right click&#039;&#039; on &#039;&#039;boxxie&#039;&#039; and then &#039;&#039;copy&#039;&#039; and  &#039;&#039;paste&#039;&#039; back into your Moodle &#039;&#039;theme&#039;&#039; directory. You should now have a folder called &#039;&#039;Copy of boxxie&#039;&#039;. If you &#039;&#039;right click&#039;&#039; this folder you are given the option to &#039;&#039;Rename&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;foxxie&#039;&#039; (or to whatever name you want to call your &#039;&#039;cloned&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;foxxie&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;lang/en/&#039;&#039; contain a file &#039;&#039;theme_boxxie.php&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;foxxie&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;cloning&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;boxxie&#039;&#039;, occurs. The first place to look, as mentioned above, is lang/en/theme_boxxie.php. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;right click&#039;&#039; on this file and &#039;&#039;rename&#039;&#039; it &#039;&#039;theme_foxxie.php&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;foxxie/lang/en/&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;foxxie/lang/&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: foxxie/lang/it/theme_foxxie.php (where &#039;&#039;it&#039;&#039; represent Italian).&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82800</id>
		<title>Development:Themes 2.0 how to clone a Moodle 2.0 theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_how_to_clone_a_Moodle_2.0_theme&amp;diff=82800"/>
		<updated>2011-04-17T05:42:46Z</updated>

		<summary type="html">&lt;p&gt;Tqr: Created page with &amp;quot;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document describes how to clone a theme from an existing Moodle 2.0. theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of HTML and CSS.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
The first thing to create is a copy of the theme folder, of the theme, you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;Boxxie&#039;&#039;, which is one of several Moodle &#039;&#039;core&#039;&#039; themes. &lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;theme&#039;&#039; directory &#039;&#039;right click&#039;&#039; on &#039;&#039;boxxie&#039;&#039; and then &#039;&#039;copy&#039;&#039; and  &#039;&#039;paste&#039;&#039; back into your Moodle &#039;&#039;theme&#039;&#039; directory. You should now have a folder called &#039;&#039;Copy of boxxie&#039;&#039;. If you &#039;&#039;right click&#039;&#039; this folder you are given the option to &#039;&#039;Rename&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;foxxie&#039;&#039; (or to whatever name you want to call your &#039;&#039;cloned&#039;&#039; theme).  &lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;foxxie&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;lang/en/&#039;&#039; contain a file &#039;&#039;theme_boxxie.php&#039;&#039; which will need to be re-named. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;foxxie&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme settings are.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for general pages.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
&lt;br /&gt;
==Re-naming some elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;cloning&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;boxxie&#039;&#039;, occurs. The first place to look, as mentioned above, is lang/en/theme_boxxie.php. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;right click&#039;&#039; on this file and &#039;&#039;rename&#039;&#039; it &#039;&#039;theme_foxxie&#039;&#039; before we open it. &lt;br /&gt;
&lt;br /&gt;
When you open this file you will see lots of $strings which are used for any customised words or phrases used in this theme. Because this is in the &#039;&#039;foxxie/lang/en/&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;foxxie/lang/&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: foxxie/lang/it/theme_foxxie.php (where &#039;&#039;it&#039;&#039; represent Italian).  &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Development:Themes 2.0 FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0&amp;diff=82799</id>
		<title>Development:Themes 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0&amp;diff=82799"/>
		<updated>2011-04-17T03:47:17Z</updated>

		<summary type="html">&lt;p&gt;Tqr: added new page to list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}Welcome to the new world of themes within Moodle 2.0!&lt;br /&gt;
&lt;br /&gt;
This document 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;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Moodle themes are responsible for much of the &amp;quot;look&amp;quot; of a Moodle site.  They provide the CSS for colours, layouts, fonts and so on, and can also change the structural XHTML code below that.  &lt;br /&gt;
&lt;br /&gt;
A theme can either contain all the definitions (completely stand alone) or it can extend an existing theme with one or more customizations. &lt;br /&gt;
&lt;br /&gt;
Most theme developers use the second method and simply add a few new CSS or layout definitions to their new theme. If a definition or element is not found in the new theme, it looks to the &amp;quot;parent&amp;quot; (or up the hierarchy of themes) to find one.  It an easy way to achieve just about any look you want for a theme.&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;
| /javascript/ &lt;br /&gt;
| &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;
| &lt;br /&gt;
| Contains the layout files for the theme.&lt;br /&gt;
|-&lt;br /&gt;
| /pix/ &lt;br /&gt;
| &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.jpg &lt;br /&gt;
| A screenshot of the theme to be displayed in on the theme selection screen.&lt;br /&gt;
|-&lt;br /&gt;
| /style &lt;br /&gt;
| &lt;br /&gt;
| Default location for CSS files.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|/*.css&lt;br /&gt;
|CSS files the theme requires&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;
==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;
The first setting, $THEME-&amp;gt;name 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 defines the themes that the theme will extend. In this case it is extending only the base theme.&lt;br /&gt;
&lt;br /&gt;
After this is the $THEME-&amp;gt;sheets 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;
Next we see the $THEME-&amp;gt;layouts definition. 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;
The final setting is to include a JavaScript file, as $THEME-&amp;gt;javascripts_footer. 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\styles\*.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 themes styles 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 an 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 put more emphasis on developers for using classes more appropriately.&lt;br /&gt;
&lt;br /&gt;
====The body tag====&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;
The best use of body ids and classes and writing selectors will reduce problems.&lt;br /&gt;
&lt;br /&gt;
There are many specific classes used within Moodle. We try to put them everywhere where anyone may want to apply their own styles. It is important to recognise that no one developer can be aware of the all of the class names that have been used all throughout Moodle, let alone within all of the different contributed bits and pieces available for Moodle.  It is up to the theme developer to write good rules and minimise the chances of a collision between rules because in this case good CSS is FAR more effective.&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 {border:1px solid orange;)&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 {border:1px solid orange;}&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;
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. For both situations these layouts should be defined within config.php.&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;
So layouts... 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 an 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 infact 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.&lt;br /&gt;
For those of you who are familiar with themes in Moodle 1.9 this is simply header.html and footer.html combined.&lt;br /&gt;
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 VERY simple PHP calls to get bits and pieces including content.&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 echo $OUTPUT-&amp;gt;login_info(); echo $PAGE-&amp;gt;headingmenu; ?&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;
Lets assume you know a enough HTML to understand the basic structure above, what you probably don&#039;t understand are the PHP calls so lets look at them.&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;
&#039;&#039;&#039;$OUTPUT&#039;&#039;&#039; is an instance of the &#039;&#039;&#039;core_renderer&#039;&#039;&#039; 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 &#039;&#039;&#039;moodle_page&#039;&#039;&#039; 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, some magic is going on, and the value you get is produced by calling a function. Also, you cannot change these values, they are read-only. 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;
==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 there 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 {background-image:url([[pix:theme|imageone]]);}&lt;br /&gt;
.divtwo {background-image:url([[pix:theme|subdir/imagetwo]]);}&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/moodlelogo.gif&lt;br /&gt;
# /theme/themename/pix/i/user.gif&lt;br /&gt;
How easy is that!&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/moodlelogo.png&lt;br /&gt;
# /theme/themename/pix/i/user.bmp&lt;br /&gt;
&lt;br /&gt;
For a more detailed description of how this all works see the page on [[Development:Themes_2.0_How_to_use_images_within_your_theme|using images within your theme]]&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 /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;
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 April 28th, 2010===&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;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;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;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;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;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;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;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&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;
===The different layouts as of August 17th, 2010===&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;
| Embeded 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 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;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Development:Themes 2.0 creating your first theme]] - A quick step by step guide to creating your first theme.&lt;br /&gt;
* [[Development:Themes 2.0 overriding a renderer]] - A tutorial on creating a custom renderer and changing the HTML Moodle produces.&lt;br /&gt;
* [[Development:Themes 2.0 How to use images within your theme]] - Explains how to use and override images within your theme.&lt;br /&gt;
* [[Development:Themes 2.0 adding a settings page]] - Looks at how to add a setting page making your theme easily customisable.&lt;br /&gt;
* [[Development:Themes 2.0 extending the custom menu]] - Customising the custom menu.&lt;br /&gt;
* [[Development:Themes 2.0 how to make the dock horizontal]] - Modifying the dock to make it horizontal.&lt;br /&gt;
* [[Development:Themes 2.0 adding upgrade code]]&lt;br /&gt;
* [[Development:Styling and customising the dock]] - How to style and customise the dock.&lt;br /&gt;
* [[Development:Theme changes in 2.0]]&lt;br /&gt;
* [[Development:Using jQuery with Moodle 2.0]]&lt;br /&gt;
* [[Development:Themes 2.0 how to clone a Moodle 2.0 theme]] &lt;br /&gt;
* [http://www.youtube.com/watch?v=OvaU54uh-qA New themes in Moodle 2.0 video]&lt;br /&gt;
&lt;br /&gt;
[[de:Designs 2.0]]&lt;br /&gt;
[[es:Temas 2.0]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82643</id>
		<title>Development:Using jQuery with Moodle 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82643"/>
		<updated>2011-04-07T20:50:20Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Themes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}Having just been helping someone with a jQuery integration I thought I would document the simple process of including the jQuery library within a theme, block, or module and how to make use of it.&lt;br /&gt;
&lt;br /&gt;
==Before we begin==&lt;br /&gt;
Moodle has officially chosen to use the YUI JavaScript library and it is encouraged to use that wherever possible. That being said, jQuery is very popular, and for what ever reason, it may be required.&lt;br /&gt;
&lt;br /&gt;
I can&#039;t guarantee what you are doing will work nicely next to YUI, but hopefully it will!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure you get the latest jQuery files from http://docs.jquery.com/Downloading_jQuery. For the purposes of this document I have downloaded jquery-1.4.2.min.js.&lt;br /&gt;
&lt;br /&gt;
You will also need to decide where to load the JavaScript. Moodle can load JavaScript into either the pages head, or at the bottom of the page (footer). Loading it into the footer is what Moodle does by default and is certainly the preferable solution if possible. It ensures that the page loads and renderers faster. However, if you need code immediately within the page WHILE it is loading, then you will want to include it in the head.&lt;br /&gt;
&lt;br /&gt;
==Including jQuery within a plugin==&lt;br /&gt;
===Themes===&lt;br /&gt;
Themes are not the easiest type of plugin to include jQuery, but if you are working on an installation that will be using a lot of customised code, then probably it is the best place.&lt;br /&gt;
&lt;br /&gt;
# Open the theme you want to add jQuery to in a file browser and if there isn&#039;t already a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory create one.&lt;br /&gt;
# Copy the jQuery files you want to make use of into the javascript directory of the theme.&lt;br /&gt;
# Open the themes config.php in your favourite editor (Notepad)&lt;br /&gt;
#* If you want to load your jQuery into the footer [recommended] then locate &#039;&#039;&#039;$THEME-&amp;gt;javascripts_footer...&#039;&#039;&#039;&lt;br /&gt;
#* If you want to load it into the header then located &#039;&#039;&#039;$THEME-&amp;gt;javascripts...&#039;&#039;&#039;&lt;br /&gt;
#* If the one you want doesn&#039;t exist create it now at the bottom of the config.php file: $THEME-&amp;gt;javascripts_footer = array();&lt;br /&gt;
# Add the names of the jQuery files you&#039;ve just copied into the javascript folder to the config option you just found/created. The names should be in single quotes and separated by commas. You do *NOT* need to put the file extension just the name.&lt;br /&gt;
&lt;br /&gt;
You should end up with the following directory structure:&lt;br /&gt;
&lt;br /&gt;
* moodle/theme/standard/javascript/jquery-1.4.2.min.js&lt;br /&gt;
* moodle/theme/standard/javascript/another.file.js&lt;br /&gt;
&lt;br /&gt;
And the following entry in your themes config.php file:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Remember we don&#039;t put the file extension so no .js at the end&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array(&#039;jquery-1.4.2.min&#039;, &#039;another.file&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that jQuery is now being loaded within your theme!&lt;br /&gt;
&lt;br /&gt;
However you won&#039;t see it immediately, first you need to clear Moodles theme cache. This can be done is two ways when logged in as an Admin:&lt;br /&gt;
&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector. At the top of the page will be a button to invalidate the theme cache.&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme settings. Turn on Theme Designer Mode.&lt;br /&gt;
&lt;br /&gt;
I would highly recommend turning theme designer mode on if you are going to making lots of changes to your themes CSS or JavaScript otherwise you will need to invalidate your theme caches after every change. Do note however that turning it on will reduce your performance as nothing will be cached.&lt;br /&gt;
&lt;br /&gt;
You should also note that Moodle combines all of the JavaScript for a theme into a single file for the header and a single file for the footer. This file is all of the JavaScript files for the section combined into a single file and minified. If you use a tool such as Firebug to view the JavaScript look for a file with a URL pointing to &#039;&#039;&#039;theme/javascript.php?...type=footer&#039;&#039;&#039;. All of the JavaScript will be in there.&lt;br /&gt;
&lt;br /&gt;
When adding files to the $THEME-&amp;gt;javascripts array the files are added in the order you specify, so the first file gets included first.&lt;br /&gt;
&lt;br /&gt;
===Blocks and modules===&lt;br /&gt;
This is much simplier than including jQuery from within a theme.&lt;br /&gt;
&lt;br /&gt;
# Create a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory within your Module, this is where we will put the jQuery files (and probably any other JavaScript files you need)&lt;br /&gt;
# Copy the jQuery files into the javascript folder.&lt;br /&gt;
# Add the following lines of php into every file which will make use of jQuery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;mod/modname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;blocks/blockname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it, it is served within the footer of those pages.&lt;br /&gt;
&lt;br /&gt;
If you want to include jQuery within the page header however you will need to specify true as the second argument.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;, true);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Potential problems==&lt;br /&gt;
You should be aware that jQuery is only designed to be included within a page once, unfortunately you are the controller of this and will need to ensure it complies.&lt;br /&gt;
&lt;br /&gt;
If you are writing customisations for your own site then it is not a problem, you can either include it within your theme once (and know it will be everywhere), or you can move the files to a central location (e.g. moodle/lib/jquery/*) and then include them from there using the block and module syntax.&lt;br /&gt;
&lt;br /&gt;
If however you are using third party plugins, where more than one is making use of jQuery, you may find VERY strange things happening. You will either need to remove the modules or move the jQuery files to a central location, as above, edit the plugins to find the files there.&lt;br /&gt;
&lt;br /&gt;
Note: A file within one location will only be included once within a page.&lt;br /&gt;
&lt;br /&gt;
For these reasons it is &#039;&#039;&#039;HIGHLY&#039;&#039;&#039; recommended to use YUI for everything possible.&lt;br /&gt;
&lt;br /&gt;
==More information==&lt;br /&gt;
For more information on how to use JavaScript within Moodle 2.0 please see [[Development:JavaScript guidelines]]&lt;br /&gt;
&lt;br /&gt;
* [[Development:JavaScript guidelines]]&lt;br /&gt;
* [[Development:Themes 2.0]]&lt;br /&gt;
&lt;br /&gt;
* [[Javascript FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82642</id>
		<title>Development:Using jQuery with Moodle 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82642"/>
		<updated>2011-04-07T20:42:40Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Before we begin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}Having just been helping someone with a jQuery integration I thought I would document the simple process of including the jQuery library within a theme, block, or module and how to make use of it.&lt;br /&gt;
&lt;br /&gt;
==Before we begin==&lt;br /&gt;
Moodle has officially chosen to use the YUI JavaScript library and it is encouraged to use that wherever possible. That being said, jQuery is very popular, and for what ever reason, it may be required.&lt;br /&gt;
&lt;br /&gt;
I can&#039;t guarantee what you are doing will work nicely next to YUI, but hopefully it will!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure you get the latest jQuery files from http://docs.jquery.com/Downloading_jQuery. For the purposes of this document I have downloaded jquery-1.4.2.min.js.&lt;br /&gt;
&lt;br /&gt;
You will also need to decide where to load the JavaScript. Moodle can load JavaScript into either the pages head, or at the bottom of the page (footer). Loading it into the footer is what Moodle does by default and is certainly the preferable solution if possible. It ensures that the page loads and renderers faster. However, if you need code immediately within the page WHILE it is loading, then you will want to include it in the head.&lt;br /&gt;
&lt;br /&gt;
==Including jQuery within a plugin==&lt;br /&gt;
===Themes===&lt;br /&gt;
This isn&#039;t the easiest type of plugin to include jQuery within but if you are working on an installation that will be using a lot of customised code then probably the best place.&lt;br /&gt;
&lt;br /&gt;
# Open the theme you want to add jQuery to in a file browser and if there isn&#039;t already a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory create one.&lt;br /&gt;
# Copy the jQuery files you want to make use of into the javascript directory of the theme.&lt;br /&gt;
# Open the themes config.php in your favourite editor&lt;br /&gt;
#* If you want to load your jQuery into the footer [recommended] then locate &#039;&#039;&#039;$THEME-&amp;gt;javascripts_footer...&#039;&#039;&#039;&lt;br /&gt;
#* If you want to load it into the header then located &#039;&#039;&#039;$THEME-&amp;gt;javascripts...&#039;&#039;&#039;&lt;br /&gt;
#* If the one you want doesn&#039;t exist create it now at the bottom of the config.php file: $THEME-&amp;gt;javascripts_footer = array();&lt;br /&gt;
# Add the names of the jQuery files you&#039;ve just copied into the javascript folder to the config option you just found/created. The names should be in single quotes and separated by commas. You do *NOT* need to put the file extension just the name.&lt;br /&gt;
&lt;br /&gt;
You should end up with the following directory structure:&lt;br /&gt;
&lt;br /&gt;
* moodle/theme/standard/javascript/jquery-1.4.2.min.js&lt;br /&gt;
* moodle/theme/standard/javascript/another.file.js&lt;br /&gt;
&lt;br /&gt;
And the following entry in your themes config.php file:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Remember we don&#039;t put the file extension so no .js at the end&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array(&#039;jquery-1.4.2.min&#039;, &#039;another.file&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that jQuery is now being loaded within your theme!&lt;br /&gt;
&lt;br /&gt;
However you won&#039;t see it immediately, first you need to clear Moodles theme cache. This can be done is two ways when logged in as an Admin:&lt;br /&gt;
&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector. At the top of the page will be a button to invalidate the theme cache.&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme settings. Turn on Theme Designer Mode.&lt;br /&gt;
&lt;br /&gt;
I would highly recommend turning theme designer mode on if you are going to making lots of changes to your themes CSS or JavaScript otherwise you will need to invalidate your theme caches after every change. Do note however that turning it on will reduce your performance as nothing will be cached.&lt;br /&gt;
&lt;br /&gt;
You should also note that Moodle combines all of the JavaScript for a theme into a single file for the header and a single file for the footer. This file is all of the JavaScript files for the section combined into a single file and minified. If you use a tool such as Firebug to view the JavaScript look for a file with a URL pointing to &#039;&#039;&#039;theme/javascript.php?...type=footer&#039;&#039;&#039;. All of the JavaScript will be in there.&lt;br /&gt;
&lt;br /&gt;
When adding files to the $THEME-&amp;gt;javascripts array the files are added in the order you specify, so the first file gets included first.&lt;br /&gt;
&lt;br /&gt;
===Blocks and modules===&lt;br /&gt;
This is much simplier than including jQuery from within a theme.&lt;br /&gt;
&lt;br /&gt;
# Create a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory within your Module, this is where we will put the jQuery files (and probably any other JavaScript files you need)&lt;br /&gt;
# Copy the jQuery files into the javascript folder.&lt;br /&gt;
# Add the following lines of php into every file which will make use of jQuery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;mod/modname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;blocks/blockname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it, it is served within the footer of those pages.&lt;br /&gt;
&lt;br /&gt;
If you want to include jQuery within the page header however you will need to specify true as the second argument.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;, true);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Potential problems==&lt;br /&gt;
You should be aware that jQuery is only designed to be included within a page once, unfortunately you are the controller of this and will need to ensure it complies.&lt;br /&gt;
&lt;br /&gt;
If you are writing customisations for your own site then it is not a problem, you can either include it within your theme once (and know it will be everywhere), or you can move the files to a central location (e.g. moodle/lib/jquery/*) and then include them from there using the block and module syntax.&lt;br /&gt;
&lt;br /&gt;
If however you are using third party plugins, where more than one is making use of jQuery, you may find VERY strange things happening. You will either need to remove the modules or move the jQuery files to a central location, as above, edit the plugins to find the files there.&lt;br /&gt;
&lt;br /&gt;
Note: A file within one location will only be included once within a page.&lt;br /&gt;
&lt;br /&gt;
For these reasons it is &#039;&#039;&#039;HIGHLY&#039;&#039;&#039; recommended to use YUI for everything possible.&lt;br /&gt;
&lt;br /&gt;
==More information==&lt;br /&gt;
For more information on how to use JavaScript within Moodle 2.0 please see [[Development:JavaScript guidelines]]&lt;br /&gt;
&lt;br /&gt;
* [[Development:JavaScript guidelines]]&lt;br /&gt;
* [[Development:Themes 2.0]]&lt;br /&gt;
&lt;br /&gt;
* [[Javascript FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82641</id>
		<title>Development:Using jQuery with Moodle 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82641"/>
		<updated>2011-04-07T20:40:59Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Before we begin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}Having just been helping someone with a jQuery integration I thought I would document the simple process of including the jQuery library within a theme, block, or module and how to make use of it.&lt;br /&gt;
&lt;br /&gt;
==Before we begin==&lt;br /&gt;
Moodle has officially chosen to use the YUI JavaScript library and it is encouraged to use that wherever possible. That being said, jQuery is very popular, and for what ever reason, it may be required.&lt;br /&gt;
&lt;br /&gt;
I can&#039;t guarantee what you are doing will work nicely next to YUI, but hopefully it will!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure you get the latest jQuery files from http://docs.jquery.com/Downloading_jQuery. For the purposes of this document I have downloaded jquery-1.4.2.min.js.&lt;br /&gt;
&lt;br /&gt;
You will also need to decide where to load the JavaScript, Moodle can load JavaScript into either the pages head, or at the bottom of the page (footer). Loading it into the footer is what Moodle does by default and is certainly the preferable solution if possible. It ensures that the page loads and renderers faster. However, if you need code immediately within the page WHILE it is loading, then you will want to include it in the head.&lt;br /&gt;
&lt;br /&gt;
==Including jQuery within a plugin==&lt;br /&gt;
===Themes===&lt;br /&gt;
This isn&#039;t the easiest type of plugin to include jQuery within but if you are working on an installation that will be using a lot of customised code then probably the best place.&lt;br /&gt;
&lt;br /&gt;
# Open the theme you want to add jQuery to in a file browser and if there isn&#039;t already a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory create one.&lt;br /&gt;
# Copy the jQuery files you want to make use of into the javascript directory of the theme.&lt;br /&gt;
# Open the themes config.php in your favourite editor&lt;br /&gt;
#* If you want to load your jQuery into the footer [recommended] then locate &#039;&#039;&#039;$THEME-&amp;gt;javascripts_footer...&#039;&#039;&#039;&lt;br /&gt;
#* If you want to load it into the header then located &#039;&#039;&#039;$THEME-&amp;gt;javascripts...&#039;&#039;&#039;&lt;br /&gt;
#* If the one you want doesn&#039;t exist create it now at the bottom of the config.php file: $THEME-&amp;gt;javascripts_footer = array();&lt;br /&gt;
# Add the names of the jQuery files you&#039;ve just copied into the javascript folder to the config option you just found/created. The names should be in single quotes and separated by commas. You do *NOT* need to put the file extension just the name.&lt;br /&gt;
&lt;br /&gt;
You should end up with the following directory structure:&lt;br /&gt;
&lt;br /&gt;
* moodle/theme/standard/javascript/jquery-1.4.2.min.js&lt;br /&gt;
* moodle/theme/standard/javascript/another.file.js&lt;br /&gt;
&lt;br /&gt;
And the following entry in your themes config.php file:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Remember we don&#039;t put the file extension so no .js at the end&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array(&#039;jquery-1.4.2.min&#039;, &#039;another.file&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that jQuery is now being loaded within your theme!&lt;br /&gt;
&lt;br /&gt;
However you won&#039;t see it immediately, first you need to clear Moodles theme cache. This can be done is two ways when logged in as an Admin:&lt;br /&gt;
&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector. At the top of the page will be a button to invalidate the theme cache.&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme settings. Turn on Theme Designer Mode.&lt;br /&gt;
&lt;br /&gt;
I would highly recommend turning theme designer mode on if you are going to making lots of changes to your themes CSS or JavaScript otherwise you will need to invalidate your theme caches after every change. Do note however that turning it on will reduce your performance as nothing will be cached.&lt;br /&gt;
&lt;br /&gt;
You should also note that Moodle combines all of the JavaScript for a theme into a single file for the header and a single file for the footer. This file is all of the JavaScript files for the section combined into a single file and minified. If you use a tool such as Firebug to view the JavaScript look for a file with a URL pointing to &#039;&#039;&#039;theme/javascript.php?...type=footer&#039;&#039;&#039;. All of the JavaScript will be in there.&lt;br /&gt;
&lt;br /&gt;
When adding files to the $THEME-&amp;gt;javascripts array the files are added in the order you specify, so the first file gets included first.&lt;br /&gt;
&lt;br /&gt;
===Blocks and modules===&lt;br /&gt;
This is much simplier than including jQuery from within a theme.&lt;br /&gt;
&lt;br /&gt;
# Create a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory within your Module, this is where we will put the jQuery files (and probably any other JavaScript files you need)&lt;br /&gt;
# Copy the jQuery files into the javascript folder.&lt;br /&gt;
# Add the following lines of php into every file which will make use of jQuery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;mod/modname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;blocks/blockname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it, it is served within the footer of those pages.&lt;br /&gt;
&lt;br /&gt;
If you want to include jQuery within the page header however you will need to specify true as the second argument.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;, true);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Potential problems==&lt;br /&gt;
You should be aware that jQuery is only designed to be included within a page once, unfortunately you are the controller of this and will need to ensure it complies.&lt;br /&gt;
&lt;br /&gt;
If you are writing customisations for your own site then it is not a problem, you can either include it within your theme once (and know it will be everywhere), or you can move the files to a central location (e.g. moodle/lib/jquery/*) and then include them from there using the block and module syntax.&lt;br /&gt;
&lt;br /&gt;
If however you are using third party plugins, where more than one is making use of jQuery, you may find VERY strange things happening. You will either need to remove the modules or move the jQuery files to a central location, as above, edit the plugins to find the files there.&lt;br /&gt;
&lt;br /&gt;
Note: A file within one location will only be included once within a page.&lt;br /&gt;
&lt;br /&gt;
For these reasons it is &#039;&#039;&#039;HIGHLY&#039;&#039;&#039; recommended to use YUI for everything possible.&lt;br /&gt;
&lt;br /&gt;
==More information==&lt;br /&gt;
For more information on how to use JavaScript within Moodle 2.0 please see [[Development:JavaScript guidelines]]&lt;br /&gt;
&lt;br /&gt;
* [[Development:JavaScript guidelines]]&lt;br /&gt;
* [[Development:Themes 2.0]]&lt;br /&gt;
&lt;br /&gt;
* [[Javascript FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82640</id>
		<title>Development:Using jQuery with Moodle 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82640"/>
		<updated>2011-04-07T20:35:39Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Potential problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}Having just been helping someone with a jQuery integration I thought I would document the simple process of including the jQuery library within a theme, block, or module and how to make use of it.&lt;br /&gt;
&lt;br /&gt;
==Before we begin==&lt;br /&gt;
Moodle has officially chosen to use the YUI JavaScript library and it is encouraged to use that wherever possible. That being said jQuery is very popular and for what ever reason it may be required.&lt;br /&gt;
&lt;br /&gt;
I can&#039;t guarantee what you are doing will work nicely next to YUI but hopefully it will!&lt;br /&gt;
&lt;br /&gt;
So first up make sure you get the latest jQuery files from http://docs.jquery.com/Downloading_jQuery. For the purposes of this document I have downloaded jquery-1.4.2.min.js.&lt;br /&gt;
&lt;br /&gt;
You will also need to decide where to load the JavaScript, Moodle can load JavaScript into either the pages head, or at the bottom of the page. Loading it into the footer is what Moodle does by default and is certainly the preferable solution if possible. It ensures that the page loads and renderers faster. However if you need code immediately within the page WHILE it is loading then you will want to include it in the head.&lt;br /&gt;
&lt;br /&gt;
==Including jQuery within a plugin==&lt;br /&gt;
===Themes===&lt;br /&gt;
This isn&#039;t the easiest type of plugin to include jQuery within but if you are working on an installation that will be using a lot of customised code then probably the best place.&lt;br /&gt;
&lt;br /&gt;
# Open the theme you want to add jQuery to in a file browser and if there isn&#039;t already a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory create one.&lt;br /&gt;
# Copy the jQuery files you want to make use of into the javascript directory of the theme.&lt;br /&gt;
# Open the themes config.php in your favourite editor&lt;br /&gt;
#* If you want to load your jQuery into the footer [recommended] then locate &#039;&#039;&#039;$THEME-&amp;gt;javascripts_footer...&#039;&#039;&#039;&lt;br /&gt;
#* If you want to load it into the header then located &#039;&#039;&#039;$THEME-&amp;gt;javascripts...&#039;&#039;&#039;&lt;br /&gt;
#* If the one you want doesn&#039;t exist create it now at the bottom of the config.php file: $THEME-&amp;gt;javascripts_footer = array();&lt;br /&gt;
# Add the names of the jQuery files you&#039;ve just copied into the javascript folder to the config option you just found/created. The names should be in single quotes and separated by commas. You do *NOT* need to put the file extension just the name.&lt;br /&gt;
&lt;br /&gt;
You should end up with the following directory structure:&lt;br /&gt;
&lt;br /&gt;
* moodle/theme/standard/javascript/jquery-1.4.2.min.js&lt;br /&gt;
* moodle/theme/standard/javascript/another.file.js&lt;br /&gt;
&lt;br /&gt;
And the following entry in your themes config.php file:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Remember we don&#039;t put the file extension so no .js at the end&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array(&#039;jquery-1.4.2.min&#039;, &#039;another.file&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that jQuery is now being loaded within your theme!&lt;br /&gt;
&lt;br /&gt;
However you won&#039;t see it immediately, first you need to clear Moodles theme cache. This can be done is two ways when logged in as an Admin:&lt;br /&gt;
&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector. At the top of the page will be a button to invalidate the theme cache.&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme settings. Turn on Theme Designer Mode.&lt;br /&gt;
&lt;br /&gt;
I would highly recommend turning theme designer mode on if you are going to making lots of changes to your themes CSS or JavaScript otherwise you will need to invalidate your theme caches after every change. Do note however that turning it on will reduce your performance as nothing will be cached.&lt;br /&gt;
&lt;br /&gt;
You should also note that Moodle combines all of the JavaScript for a theme into a single file for the header and a single file for the footer. This file is all of the JavaScript files for the section combined into a single file and minified. If you use a tool such as Firebug to view the JavaScript look for a file with a URL pointing to &#039;&#039;&#039;theme/javascript.php?...type=footer&#039;&#039;&#039;. All of the JavaScript will be in there.&lt;br /&gt;
&lt;br /&gt;
When adding files to the $THEME-&amp;gt;javascripts array the files are added in the order you specify, so the first file gets included first.&lt;br /&gt;
&lt;br /&gt;
===Blocks and modules===&lt;br /&gt;
This is much simplier than including jQuery from within a theme.&lt;br /&gt;
&lt;br /&gt;
# Create a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory within your Module, this is where we will put the jQuery files (and probably any other JavaScript files you need)&lt;br /&gt;
# Copy the jQuery files into the javascript folder.&lt;br /&gt;
# Add the following lines of php into every file which will make use of jQuery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;mod/modname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;blocks/blockname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it, it is served within the footer of those pages.&lt;br /&gt;
&lt;br /&gt;
If you want to include jQuery within the page header however you will need to specify true as the second argument.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;, true);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Potential problems==&lt;br /&gt;
You should be aware that jQuery is only designed to be included within a page once, unfortunately you are the controller of this and will need to ensure it complies.&lt;br /&gt;
&lt;br /&gt;
If you are writing customisations for your own site then it is not a problem, you can either include it within your theme once (and know it will be everywhere), or you can move the files to a central location (e.g. moodle/lib/jquery/*) and then include them from there using the block and module syntax.&lt;br /&gt;
&lt;br /&gt;
If however you are using third party plugins, where more than one is making use of jQuery, you may find VERY strange things happening. You will either need to remove the modules or move the jQuery files to a central location, as above, edit the plugins to find the files there.&lt;br /&gt;
&lt;br /&gt;
Note: A file within one location will only be included once within a page.&lt;br /&gt;
&lt;br /&gt;
For these reasons it is &#039;&#039;&#039;HIGHLY&#039;&#039;&#039; recommended to use YUI for everything possible.&lt;br /&gt;
&lt;br /&gt;
==More information==&lt;br /&gt;
For more information on how to use JavaScript within Moodle 2.0 please see [[Development:JavaScript guidelines]]&lt;br /&gt;
&lt;br /&gt;
* [[Development:JavaScript guidelines]]&lt;br /&gt;
* [[Development:Themes 2.0]]&lt;br /&gt;
&lt;br /&gt;
* [[Javascript FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82639</id>
		<title>Development:Using jQuery with Moodle 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Using_jQuery_with_Moodle_2.0&amp;diff=82639"/>
		<updated>2011-04-07T20:33:49Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Potential problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}Having just been helping someone with a jQuery integration I thought I would document the simple process of including the jQuery library within a theme, block, or module and how to make use of it.&lt;br /&gt;
&lt;br /&gt;
==Before we begin==&lt;br /&gt;
Moodle has officially chosen to use the YUI JavaScript library and it is encouraged to use that wherever possible. That being said jQuery is very popular and for what ever reason it may be required.&lt;br /&gt;
&lt;br /&gt;
I can&#039;t guarantee what you are doing will work nicely next to YUI but hopefully it will!&lt;br /&gt;
&lt;br /&gt;
So first up make sure you get the latest jQuery files from http://docs.jquery.com/Downloading_jQuery. For the purposes of this document I have downloaded jquery-1.4.2.min.js.&lt;br /&gt;
&lt;br /&gt;
You will also need to decide where to load the JavaScript, Moodle can load JavaScript into either the pages head, or at the bottom of the page. Loading it into the footer is what Moodle does by default and is certainly the preferable solution if possible. It ensures that the page loads and renderers faster. However if you need code immediately within the page WHILE it is loading then you will want to include it in the head.&lt;br /&gt;
&lt;br /&gt;
==Including jQuery within a plugin==&lt;br /&gt;
===Themes===&lt;br /&gt;
This isn&#039;t the easiest type of plugin to include jQuery within but if you are working on an installation that will be using a lot of customised code then probably the best place.&lt;br /&gt;
&lt;br /&gt;
# Open the theme you want to add jQuery to in a file browser and if there isn&#039;t already a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory create one.&lt;br /&gt;
# Copy the jQuery files you want to make use of into the javascript directory of the theme.&lt;br /&gt;
# Open the themes config.php in your favourite editor&lt;br /&gt;
#* If you want to load your jQuery into the footer [recommended] then locate &#039;&#039;&#039;$THEME-&amp;gt;javascripts_footer...&#039;&#039;&#039;&lt;br /&gt;
#* If you want to load it into the header then located &#039;&#039;&#039;$THEME-&amp;gt;javascripts...&#039;&#039;&#039;&lt;br /&gt;
#* If the one you want doesn&#039;t exist create it now at the bottom of the config.php file: $THEME-&amp;gt;javascripts_footer = array();&lt;br /&gt;
# Add the names of the jQuery files you&#039;ve just copied into the javascript folder to the config option you just found/created. The names should be in single quotes and separated by commas. You do *NOT* need to put the file extension just the name.&lt;br /&gt;
&lt;br /&gt;
You should end up with the following directory structure:&lt;br /&gt;
&lt;br /&gt;
* moodle/theme/standard/javascript/jquery-1.4.2.min.js&lt;br /&gt;
* moodle/theme/standard/javascript/another.file.js&lt;br /&gt;
&lt;br /&gt;
And the following entry in your themes config.php file:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Remember we don&#039;t put the file extension so no .js at the end&lt;br /&gt;
$THEME-&amp;gt;javascripts_footer = array(&#039;jquery-1.4.2.min&#039;, &#039;another.file&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that jQuery is now being loaded within your theme!&lt;br /&gt;
&lt;br /&gt;
However you won&#039;t see it immediately, first you need to clear Moodles theme cache. This can be done is two ways when logged in as an Admin:&lt;br /&gt;
&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector. At the top of the page will be a button to invalidate the theme cache.&lt;br /&gt;
# Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme settings. Turn on Theme Designer Mode.&lt;br /&gt;
&lt;br /&gt;
I would highly recommend turning theme designer mode on if you are going to making lots of changes to your themes CSS or JavaScript otherwise you will need to invalidate your theme caches after every change. Do note however that turning it on will reduce your performance as nothing will be cached.&lt;br /&gt;
&lt;br /&gt;
You should also note that Moodle combines all of the JavaScript for a theme into a single file for the header and a single file for the footer. This file is all of the JavaScript files for the section combined into a single file and minified. If you use a tool such as Firebug to view the JavaScript look for a file with a URL pointing to &#039;&#039;&#039;theme/javascript.php?...type=footer&#039;&#039;&#039;. All of the JavaScript will be in there.&lt;br /&gt;
&lt;br /&gt;
When adding files to the $THEME-&amp;gt;javascripts array the files are added in the order you specify, so the first file gets included first.&lt;br /&gt;
&lt;br /&gt;
===Blocks and modules===&lt;br /&gt;
This is much simplier than including jQuery from within a theme.&lt;br /&gt;
&lt;br /&gt;
# Create a &#039;&#039;&#039;javascript&#039;&#039;&#039; directory within your Module, this is where we will put the jQuery files (and probably any other JavaScript files you need)&lt;br /&gt;
# Copy the jQuery files into the javascript folder.&lt;br /&gt;
# Add the following lines of php into every file which will make use of jQuery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;mod/modname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
// $PAGE-&amp;gt;requires-&amp;gt;js(&#039;blocks/blockname/javascript/jquery-1.4.2.min.js&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it, it is served within the footer of those pages.&lt;br /&gt;
&lt;br /&gt;
If you want to include jQuery within the page header however you will need to specify true as the second argument.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$PAGE-&amp;gt;requires-&amp;gt;js(&#039;path/to/plugin/javascript/jquery-1.4.2.min.js&#039;, true);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Potential problems==&lt;br /&gt;
You should be aware that jQuery is only designed to be included within a page once, unfortunately you are the controller of this and will need to ensure.&lt;br /&gt;
&lt;br /&gt;
If you are writing customisations for your own site then it is not a problem, you can either include it within your theme once (and know it will be everywhere), or you can move the files to a central location (e.g. moodle/lib/jquery/*) and then include them from there using the block and module syntax.&lt;br /&gt;
&lt;br /&gt;
If however you are using third party plugins, where more than one is making use of jQuery, you may find VERY strange things happening. You will either need to remove the modules or move the jQuery files to a central location, as above, edit the plugins to find the files there.&lt;br /&gt;
&lt;br /&gt;
Note: A file within one location will only be included once within a page.&lt;br /&gt;
&lt;br /&gt;
For these reasons it is &#039;&#039;&#039;HIGHLY&#039;&#039;&#039; recommended to use YUI for everything possible.&lt;br /&gt;
&lt;br /&gt;
==More information==&lt;br /&gt;
For more information on how to use JavaScript within Moodle 2.0 please see [[Development:JavaScript guidelines]]&lt;br /&gt;
&lt;br /&gt;
* [[Development:JavaScript guidelines]]&lt;br /&gt;
* [[Development:Themes 2.0]]&lt;br /&gt;
&lt;br /&gt;
* [[Javascript FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=setting:regionwidthdouble&amp;diff=82119</id>
		<title>setting:regionwidthdouble</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=setting:regionwidthdouble&amp;diff=82119"/>
		<updated>2011-03-21T01:44:22Z</updated>

		<summary type="html">&lt;p&gt;Tqr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Used in theme settings to denote double the width of a particular region, usually #region-pre or #region-post, which translates to left column and right column respectively.&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=setting:regionwidth&amp;diff=82118</id>
		<title>setting:regionwidth</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=setting:regionwidth&amp;diff=82118"/>
		<updated>2011-03-21T01:43:39Z</updated>

		<summary type="html">&lt;p&gt;Tqr: New page: Used in theme settings to denote the width of a particular region, usually #region-pre or #region-post, which translates to left column and right column respectively.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Used in theme settings to denote the width of a particular region, usually #region-pre or #region-post, which translates to left column and right column respectively.&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=setting:regionwidthdouble&amp;diff=82116</id>
		<title>setting:regionwidthdouble</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=setting:regionwidthdouble&amp;diff=82116"/>
		<updated>2011-03-21T01:40:32Z</updated>

		<summary type="html">&lt;p&gt;Tqr: New page: Used in theme settings to denote double the width of a particular region, usually #region-pre or #region-post, which translate to left column and right column respectively.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Used in theme settings to denote double the width of a particular region, usually #region-pre or #region-post, which translate to left column and right column respectively.&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=81920</id>
		<title>Development:Git for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=81920"/>
		<updated>2011-03-14T17:40:21Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Working on 2.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is for helping you get started on Moodle development with Git. For further details of Git, see [[:Category:Git]].&lt;br /&gt;
&lt;br /&gt;
== Set-up ==&lt;br /&gt;
&lt;br /&gt;
1. Go to [https://github.com/ Github] and create an account.&lt;br /&gt;
&lt;br /&gt;
2. Go to the [https://github.com/moodle/moodle official Moodle Github repository] and click on the Fork button. You now have your own github Moodle repository.&lt;br /&gt;
&lt;br /&gt;
3. Install Git on your computer. If you are on Mac, [http://code.google.com/p/git-osx-installer/ git-osx-installer] installs it in few click.&lt;br /&gt;
&lt;br /&gt;
4. Now the technical part, you will need to setup your SSH public key, so you can push to your github Moodle repository from your local Moodle repository. On Mac you can go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, go to your Github administration page, to the section SSH Public Keys, and you should see a link to a help page. Done? Good! That was the most difficult part!&lt;br /&gt;
&lt;br /&gt;
== Working on 2.0 ==&lt;br /&gt;
&lt;br /&gt;
1. Create a local clone repository of your github repository. In a terminal:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git ./YOUR_LOCAL_MOODLE_FOLDER/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
In Debian Lenny (git version 1.5) you may want to use the following command:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Before making commits, it is useful to add your name and email:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
git config --global user.email yourmail@domain.tld&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
2. You will need to create an update script in order to update your github and local repository from git.moodle.org. Add a reference to this Moodle.org Git repository and make your local master branch track it:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
cd ./YOUR_LOCAL_MOODLE_FOLDER/&lt;br /&gt;
git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
git fetch upstream&lt;br /&gt;
git branch --set-upstream master upstream/master&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Create the update script (name it &amp;quot;update_github&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
cd YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
git checkout master&lt;br /&gt;
git pull&lt;br /&gt;
git push origin refs/remotes/upstream/master:master&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run the./update_github script. Your local repository (&amp;quot;master&amp;quot; branch) and your github repository (&amp;quot;master&amp;quot; branch) will be updated from git.moodle.org.&lt;br /&gt;
&lt;br /&gt;
5. Now you can work on a new issue. You can use a Git UI tool like SmartGit for these steps:&lt;br /&gt;
* Run the update script (the script will switch to &amp;quot;master&amp;quot; branch, so take care to stash/commit the changes of your current branch). To check the current branch:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git branch -a&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Create a new branch and switch to it. You should never work in your local master branch:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
cd YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
git branch BRANCH_NAME&lt;br /&gt;
git checkout BRANCH_NAME&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Fix your issue with your favorite IDE. Check updated files:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
cd YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
git status&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Commit, push and do a pull request (FILE_NAME can be either a single file or a folder, for a folder the &amp;quot;add&amp;quot; command will be performed recursively)&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git add FILE_NAME&lt;br /&gt;
git commit&lt;br /&gt;
git push origin BRANCH_NAME&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working on 1.9 or earlier branches ==&lt;br /&gt;
This is just a tiny little bit more complicated that working on 2.0. Even though you could work in the same folder as for 2.0, you should create another folder for working on 1.9. It will make things less messy and easier to understand.&lt;br /&gt;
&lt;br /&gt;
1. In a terminal&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
 git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git ./YOUR_LOCAL_MOODLE_19_FOLDER/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Add the remote upstream. You want to update your local MOODLE_19_STABLE branch and your github (called &amp;quot;origin&amp;quot;) MOODLE_19_STABLE branch from the official Moodle upstream.&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
cd ./YOUR_LOCAL_MOODLE_19_FOLDER/&lt;br /&gt;
git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
git fetch upstream&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Now you are going to create a local 1.9 branch. You will keep this branch updated (the branch will track upstream) and you are never going to work in it.&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git checkout -b MOODLE_19_STABLE upstream/MOODLE_19_STABLE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Create the update script in ./update_github&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
cd YOUR_LOCAL_MOODLE_19_FOLDER&lt;br /&gt;
git checkout MOODLE_19_STABLE&lt;br /&gt;
git pull&lt;br /&gt;
git push origin refs/remotes/upstream/MOODLE_19_STABLE:MOODLE_19_STABLE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Run the script. Your github MOODLE_19_STABLE branch and your local MOODLE_19_STABLE branch are now updated.&lt;br /&gt;
&lt;br /&gt;
6. You can now work on an issue. You can use a Git UI tool like SmartGit for these steps:&lt;br /&gt;
* Run the update script (don&#039;t forget to stash/commit the change of your current local branch, you are going to switch to MOODLE_19_STABLE local branch)&lt;br /&gt;
* Create a new branch for your issue and switch to it&lt;br /&gt;
* Fix your issue with your favorite IDE&lt;br /&gt;
* Commit, push and do a pull request&lt;br /&gt;
&lt;br /&gt;
== Peer review some code ==&lt;br /&gt;
You need to review someone else work, They must have pushed their work into github: &lt;br /&gt;
* github repository url: git://github.com/PEER_USERNAME/moodle.git &lt;br /&gt;
* branch name: MDL-XXXXX&lt;br /&gt;
&lt;br /&gt;
1. Run the update script (it will switch to your local master branch and update the code)&lt;br /&gt;
&lt;br /&gt;
2. Add the remote repository (only first time ever, then skip this step)&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git remote add PEER_USERNAME git://github.com/PEER_USERNAME/moodle.git&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Fetch the repository, so Git knows about the last changes in it&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git fetch PEER_USERNAME&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Switch to a new local &#039;testing&#039; branch &lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git checkout -b PEER_USERNAME-MDL-XXXXX &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Import the remote change into this local branch (but not marked as &#039;committed&#039; so you can see the changes into your IDE)&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
 git merge --squash PEER_USERNAME/MDL-XXXXX&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. You can now test in your favorite IDE. If it supports Git you should see the difference with your local master.&lt;br /&gt;
&lt;br /&gt;
7. Finally you are going to delete this testing branch:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
# Warning: if you didn&#039;t switch, you should still be on testing branch. &lt;br /&gt;
# the first command revert all the changes to the &#039;master&#039; state.&lt;br /&gt;
git reset --hard&lt;br /&gt;
git checkout master&lt;br /&gt;
git branch -d PEER_USERNAME-MDL-XXXXX&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
== Update a branch before pushing your changes ==&lt;br /&gt;
To make diff easy on github for weekly pull request review, you want to update your branch before to push it to github. First commit your changes, then run the update script. You have been switched on master branch, so first thing is to go back to your working branch&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git checkout MLD-XXXX&lt;br /&gt;
git rebase master&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
At this moment either it worked fine and your branch is updated, either you had some conflicts with one of your previous branch commits.&lt;br /&gt;
Fix all your conflicts in your editor (like you will fo with CVS) and add the files with &#039;git add&#039; command. &lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git add file1 file2 file3 ...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now continue the rebasing.&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git rebase --continue&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Either it worked and your branch is updated, either one of your other commit created again some other conflicts. Restart the &#039;&#039;Fix, add, continue rebase&#039;&#039; steps until you have no conflict. Your branch is updated.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
* setup your name for every repository&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git config --global user.name &amp;quot;Firstname Lastname&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* do not push your file permission to any repository&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git config --global core.filemode false&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* If you want to delete a remote branch on github:&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git push origin :CONFLICTING_REMOTE_BRANCH_NAME&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* PHPStorm (beta version) named your &#039;origin&#039; =&amp;gt; &#039;master&#039; when you cloned your github repository. It is better to rename it as &#039;origin&#039;.&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git remote rename master origin&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* You&#039;ve been working with Git in the early stages when Moodle HQ were experimenting with it. They now changed &#039;cvshead&#039; to &#039;master&#039; into upstream (moodle.org Git). You need to rename all your &#039;cvshead&#039; github and local branches as &#039;master&#039;. There what you should do (this is not a script to run, execute the command one at the time following the instructions):&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
#go to your root git folder&lt;br /&gt;
&lt;br /&gt;
git fetch origin&lt;br /&gt;
git fetch upstream&lt;br /&gt;
git remote prune upstream&lt;br /&gt;
git remote prune origin&lt;br /&gt;
&lt;br /&gt;
/// FIRST TIME YOU RUN THIS SCRIPT&lt;br /&gt;
git checkout -b master upstream/master&lt;br /&gt;
git push origin master&lt;br /&gt;
&lt;br /&gt;
#on github, in your repository administration, change the default to &#039;master&#039;&lt;br /&gt;
&lt;br /&gt;
git push origin :cvshead&lt;br /&gt;
git branch -d cvshead&lt;br /&gt;
/// END OF FIRST TIME&lt;br /&gt;
&lt;br /&gt;
git remote set-head origin -a&lt;br /&gt;
git remote set-head upstream -a&lt;br /&gt;
 &lt;br /&gt;
/// OTHER TIME - FOR YOUR OTHER GIT MOODLE FOLDERS&lt;br /&gt;
git checkout -b master upstream/master&lt;br /&gt;
git branch -d cvshead&lt;br /&gt;
/// END OF OTHER TIME&lt;br /&gt;
 &lt;br /&gt;
#check .git/config that there is no references to &#039;cvshead&#039;, if there are replace with &#039;master&#039;&lt;br /&gt;
 &lt;br /&gt;
#optional:&lt;br /&gt;
#update your update script (&#039;cvshead&#039; =&amp;gt; &#039;master&#039;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* To know about your branches (the current branch is marked with an asterix)&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git branch -a&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
*For any help&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
git any_command --help&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Development:Tutorial_on_using_git_in_Moodle_development]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0&amp;diff=78922</id>
		<title>Development:Themes 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0&amp;diff=78922"/>
		<updated>2010-12-07T21:11:20Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Locations of CSS files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}Welcome to the new world of themes within Moodle 2.0!&lt;br /&gt;
&lt;br /&gt;
This document 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;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Moodle themes are responsible for much of the &amp;quot;look&amp;quot; of a Moodle site.  They provide the CSS for colours, layouts, fonts and so on, and can also change the structural XHTML code below that.  &lt;br /&gt;
&lt;br /&gt;
A theme can either contain all the definitions (completely stand alone) or it can extend an existing theme with one or more customizations. &lt;br /&gt;
&lt;br /&gt;
Most theme developers use the second method and simply add a few new CSS or layout definitions to their new theme. If a definition or element is not found in the new theme, it looks to the &amp;quot;parent&amp;quot; (or up the hierarchy of themes) to find one.  It an easy way to achieve just about any look you want for a theme.&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;
| /javascript/ &lt;br /&gt;
| &lt;br /&gt;
| All speciality 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;
| &lt;br /&gt;
| Contains the layout files for the theme.&lt;br /&gt;
|-&lt;br /&gt;
| /pix/ &lt;br /&gt;
| &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.jpg &lt;br /&gt;
| A screenshot of the theme to be displayed in on the theme selection screen.&lt;br /&gt;
|-&lt;br /&gt;
| /style &lt;br /&gt;
| &lt;br /&gt;
| Default location for CSS files.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|/*.css&lt;br /&gt;
|CSS files the theme requires&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;
==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;
The first setting, $THEME-&amp;gt;name 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 defines the themes that the theme will extend. In this case it is extending only the base theme.&lt;br /&gt;
&lt;br /&gt;
After this is the $THEME-&amp;gt;sheets 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;
Next we see the $THEME-&amp;gt;layouts definition. 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;
The final setting is to include a JavaScript file, as $THEME-&amp;gt;javascripts_footer. 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 start out theming, 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\styles\*.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 themes styles 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 an 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 put more emphasis on developers for using classes more appropriately.&lt;br /&gt;
&lt;br /&gt;
====The body tag====&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;
The best use of body ids and classes and writing selectors will reduce problems.&lt;br /&gt;
&lt;br /&gt;
There are many specific classes used within Moodle. We try to put them everywhere where anyone may want to apply their own styles. It is important to recognise that no one developer can be aware of the all of the class names that have been used all throughout Moodle, let alone within all of the different contributed bits and pieces available for Moodle.  It is up to the theme developer to write good rules and minimise the chances of a collision between rules because in this case good CSS is FAR more effective.&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 {border:1px solid orange;)&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 {border:1px solid orange;}&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;
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. For both situations these layouts should be defined within config.php.&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;
So layouts... 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.&lt;br /&gt;
; file : is the name of the layout file this layout wants to use.&lt;br /&gt;
; regions : is the different block regions (places you can put blocks) within the theme.&lt;br /&gt;
; defaultregion : is the default location when adding new blocks.&lt;br /&gt;
; options : an array of layout specific options described in detail below.&lt;br /&gt;
&lt;br /&gt;
The first four settings are required by each layout definition however the final setting `options` 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 infact 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.&lt;br /&gt;
For those of you who are familiar with themes in Moodle 1.9 this is simply header.html and footer.html combined.&lt;br /&gt;
Of course it is not all HTML, there is 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 VERY simple PHP calls to get bits and pieces including content.&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 echo $PAGE-&amp;gt;bodyid ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php echo $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 echo $OUTPUT-&amp;gt;login_info(); echo $PAGE-&amp;gt;headingmenu; ?&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;
Lets assume you know a enough HTML to understand the basic structure above, what you probably don&#039;t understand are the PHP calls so lets look at them.&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 themer 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 echo $PAGE-&amp;gt;bodyid; ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php echo $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;
==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 there 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;
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 {background-image:url([[pix:theme|imageone]]);}&lt;br /&gt;
.divtwo {background-image:url([[pix:theme|subdir/imagetwo]]);}&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/moodlelogo.gif&lt;br /&gt;
# /theme/themename/pix/i/user.gif&lt;br /&gt;
How easy is that!&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/moodlelogo.png&lt;br /&gt;
# /theme/themename/pix/i/user.bmp&lt;br /&gt;
&lt;br /&gt;
For a more detailed description of how this all works see the page on [[Development:Themes_2.0_How_to_use_images_within_your_theme|using images within your theme]]&lt;br /&gt;
&lt;br /&gt;
==Appendix A==&lt;br /&gt;
===Theme options as of April 28th, 2010===&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;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;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;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;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;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;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;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&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;
===The different layouts as of August 17th, 2010===&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;
| Embeded 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 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;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://www.youtube.com/watch?v=OvaU54uh-qA New themes in Moodle 2.0 video]&lt;br /&gt;
* [[Development:Themes 2.0 creating your first theme]] - A quick step by step guide to creating your first theme.&lt;br /&gt;
* [[Development:Themes 2.0 overriding a renderer]] - A tutorial on creating a custom renderer and changing the HTML Moodle produces.&lt;br /&gt;
* [[Development:Themes 2.0 How to use images within your theme]] - Explains how to use and override images within your theme.&lt;br /&gt;
* [[Development:Themes 2.0 adding a settings page]] - Looks at how to add a setting page making your theme easily customisable.&lt;br /&gt;
* [[Development:Themes 2.0 extending the custom menu]] - Customising the custom menu.&lt;br /&gt;
* [[Development:Styling and customising the dock]] - How to style and customise the dock.&lt;br /&gt;
* [[Development:Theme changes in 2.0]]&lt;br /&gt;
* [[Development:Using jQuery with Moodle 2.0]]&lt;br /&gt;
&lt;br /&gt;
[[de:Designs 2.0]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=77477</id>
		<title>Themes FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=77477"/>
		<updated>2010-11-05T10:31:53Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Why is the new theme I uploaded not showing up in Theme Selector? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
==How do I install a new theme?==&lt;br /&gt;
&lt;br /&gt;
# Unzip the .zip file to an empty local directory.&lt;br /&gt;
# Upload folder to your web server to the /moodle/theme/[Theme Name]. (Replace [Theme Name] with the name of the theme you have downloaded.) Ensure the new theme folder and its contents are readable by the webserver.  Change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
=== How do I install a new theme when using cPanel? ===&lt;br /&gt;
&lt;br /&gt;
# Upload your new theme .zip file to your web server via cPanel. &lt;br /&gt;
# Then using cPanel install the new theme to your Moodle theme&#039;s folder.  The new theme will be installed into its own folder at /moodle/theme/[mytheme] (where [mytheme] is the name of your new theme.&lt;br /&gt;
# Ensure the new theme folder and its contents are readable by the webserver. If necessary  change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
=== Why is the new theme I uploaded not showing up in Theme Selector? ===&lt;br /&gt;
&lt;br /&gt;
# There could be a number of problems with the theme you uploaded, but one major problem reported in the Themes Forum all point to the way in which the theme is uploaded on certain servers. Using the cPanel method, as described in the previous section 1.1 [[How do I install a new theme when using cPanel?]] (see above) will, in most cases, cure the problem.&lt;br /&gt;
&lt;br /&gt;
==How do I create a custom theme?==&lt;br /&gt;
&lt;br /&gt;
See [[Creating a custom theme]] and/or [[Make your own theme]].&lt;br /&gt;
&lt;br /&gt;
==Can I assign a specific theme to a course?==&lt;br /&gt;
&lt;br /&gt;
Yes. In the course settings, use the &amp;quot;Force theme&amp;quot; dropdown box.&lt;br /&gt;
&lt;br /&gt;
== Where shall I put my custom CSS code? ==&lt;br /&gt;
&lt;br /&gt;
Instead of modifying the theme&#039;s CSS files you better put your own code in a separate CSS file and make your theme aware of that file by modifying its config.php file (be sure add your own CSS file as the last one in the list so that you will override all prior settings). See this posting for [http://moodle.org/mod/forum/discuss.php?d=128599#p564055 detailed instructions]. &lt;br /&gt;
&lt;br /&gt;
See also the instructions on creating your own theme mentioned above.&lt;br /&gt;
&lt;br /&gt;
==How can I get the New Moodle2 theme for my site?==&lt;br /&gt;
Not til Moodle 2.x comes out and it will be a &amp;quot;sort of&amp;quot;.  The new look (refered to as &amp;quot;Moodle2&amp;quot;) for Moodle.org was made public just before the close of 2008. The Moodle2 look has various things hard coded into its fabric.   The good news is that many pieces of the look are available.&lt;br /&gt;
&lt;br /&gt;
==Will I lose my courses, language files, logo, etc. if I switch my theme?==&lt;br /&gt;
Switching themes only changes the appearance of your site, not the content within it. The logo is a part of the theme and will be lost when you switch.&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to [[Creating_a_custom_theme#Adding_a_Logo|add a logo]] to a theme.&lt;br /&gt;
&lt;br /&gt;
== Are there tools which help me creating and editing themes? ==&lt;br /&gt;
&lt;br /&gt;
=== Clear Cache Button ===&lt;br /&gt;
This useful Firefox add-on let&#039;s you add a button to your tool bar for easily clearing your cache while working on your theme: https://addons.mozilla.org/de/firefox/addon/1801&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;Please note that the following tools are only for development. They only change the way &#039;&#039;you&#039;&#039; see your Moodle site, not the Moodle site itself. Any changes you make using these tools will not be visible to anyone else who uses your site. For this you will have to make those changes permanent by changing your theme&#039;s CSS files for example.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firebug ===&lt;br /&gt;
The single most useful tool is the [[Development:Firebug|Firebug]] add-on for the [[Firefox]] web browser. Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page... And there are additional add-ons for making Firebug an even more powerful tool.&lt;br /&gt;
&lt;br /&gt;
==== Firebug enhancements ====&lt;br /&gt;
You can enhance Firebug even further. See [[Firebug]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Web Developer Toolbar ===&lt;br /&gt;
Another great tool for any web developer is the [[Web developer extension]], another Firefox add-on. One very useful feature is the option to &#039;&#039;&#039;disable your browser&#039;s cache&#039;&#039;&#039; while working on your theme. That way you are sure you&#039;re always presented with your latest modifications and not with an older, cached version.&lt;br /&gt;
&lt;br /&gt;
Now also available for Google&#039;s Chrome browser: [http://www.sitepoint.com/blogs/2010/03/23/chrome-web-developer-toolbar/ &amp;quot;The Web Developer Toolbar Comes to Chrome&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Stylish ===&lt;br /&gt;
Modifications made with Firebug are lost when refreshing your page. If you want your CSS changes to be a bit more permanent, for example to try them with different pages of your Moodle installation, you can use another Firefox plugin: [https://addons.mozilla.org/en-US/firefox/addon/2108 Stylish]. That way you can change your site&#039;s CSS with a simple mouse click without having to change Moodle code.&lt;br /&gt;
&lt;br /&gt;
See [[Stylish]] for detailed instructions and examples.&lt;br /&gt;
&lt;br /&gt;
== How do I check for cross-browser compatibility? ==&lt;br /&gt;
There are some tools (standalone and online) which can show you how your site looks in different browsers. See this [http://moodle.org/mod/forum/discuss.php?d=127746 forum discussion] for details.&lt;br /&gt;
&lt;br /&gt;
== Concrete examples for modifying Moodle themes ==&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
The following examples were taken from the former &#039;&#039;Theme Scrapbook&#039;&#039;:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;The Moodle &#039;&#039;&#039;Theme Scrapbook&#039;&#039;&#039; is a collection of small how-to descriptions. You theme designers and Moodle users working with themes add your knowledge here to help new Moodle users with tips and tricks for their theme work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Feel free to add to this list! Don&#039;t know how? Read our [[MoodleDocs:Guidelines_for_contributors|Guidelines for contributors]].&amp;quot;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing things ===&lt;br /&gt;
&lt;br /&gt;
==== Colors ====&lt;br /&gt;
* [[Forcing the colour of the chat discussion pane (pop-up mode)]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=142765 Changing background colour of a topic box]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=152357 How to change the colour of the popup event&#039;s header and background]&lt;br /&gt;
&lt;br /&gt;
==== Logo and icons ====&lt;br /&gt;
* [[Alternate Icon Set|Using an alternate icon set in Moodle]]&lt;br /&gt;
* [[Favicon|Change the favicon that shows in front of the web address]]&lt;br /&gt;
* [[Footer replacement|Replace the logo in the footer with your web address and/or or own logo]]&lt;br /&gt;
*[[Header logo|Replace the logo in the header]]&lt;br /&gt;
&lt;br /&gt;
==== Layout ====&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=136546 Overriding the $menu / $button variables] using PHP regular expressions in header.html&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=143411 Changing the view of course categories] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145077 Sub categories and courses layout] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=151370 Tracker &#039;components&#039; list too small]&lt;br /&gt;
&lt;br /&gt;
=== Adding things ===&lt;br /&gt;
* [[Header logo|Adding a logo to the theme header]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=157935 How to add a different img-bullet to each category?]&lt;br /&gt;
&lt;br /&gt;
=== Hiding things ===&lt;br /&gt;
* Hiding an element with CSS is generally achieved using the [http://reference.sitepoint.com/css/display display: none;] property on the element.&lt;br /&gt;
* See [[Print style]] and [[Stylish#Print style for Database records]] for an example how to hide parts of a page not meant for printing.&lt;br /&gt;
&lt;br /&gt;
=== Moving things ===&lt;br /&gt;
* [[Center Forum Posts|Centre smaller forum posts on the page]]&lt;br /&gt;
* [[Footer positioning|Positioning the page footer]]&lt;br /&gt;
* [[Left-align quiz|Left align quiz questions and answers]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=121847 Indentation for nested categories]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=128599 Positioning login and choose language field]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145179 Match question type - position answers nearer to the questions]&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous ===&lt;br /&gt;
* [[Fixed-width theme|Creating a fixed-width theme]]&lt;br /&gt;
* [[Homepage design|Homepage design of moodle.org]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=146763 Is there a way to fix oversized HTML Editor using CSS?]&lt;br /&gt;
&lt;br /&gt;
==How can I see theme changes when using the Windows Complete Installer package==&lt;br /&gt;
In the [http://download.moodle.org/windows/ Windows Complete Installer package], the eAccelerator in the XAMPP install can cause some issues with changes to your theme&#039;s CSS and HTML files from showing.&lt;br /&gt;
&lt;br /&gt;
Open the php.ini file inside of the server\php folder from your install in notepad and search for &amp;quot;eAccelerator&amp;quot; you should see a line that reads: &lt;br /&gt;
 extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Insert a semi-colon (turns the line into a comment) at the start of this line so it now reads: &lt;br /&gt;
 ;extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Restart the Moodle server using the &amp;quot;stop moodle&amp;quot; and then the &amp;quot;start moodle&amp;quot; programs in your server folder. You should now find that all of your changes to your CSS are reflected as soon as you save the file and refresh your browser cache (usually you can refresh your cache by pressing F5). This FAQ from a discussion at [http://moodle.org/mod/forum/discuss.php?d=151562#p663950 Deactivating caching with XAMPP installations]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?f=29 Themes forum]&lt;br /&gt;
* [[CSS FAQ]]&lt;br /&gt;
* [http://learn.open.ac.uk/mod/oublog/view.php?user=155976 &amp;quot;Understanding Moodle Themes&amp;quot;] - Blog post by [http://moodle.org/user/view.php?id=78896&amp;amp;course=5 Christopher Douce] (Open University)&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=149534 Testing 2.0. Use for modern vs old browsers] forum discussion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[de:Designs_FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=77476</id>
		<title>Themes FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=77476"/>
		<updated>2010-11-05T10:31:26Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Why is the new theme I uploaded not showing up in Theme Selector? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
==How do I install a new theme?==&lt;br /&gt;
&lt;br /&gt;
# Unzip the .zip file to an empty local directory.&lt;br /&gt;
# Upload folder to your web server to the /moodle/theme/[Theme Name]. (Replace [Theme Name] with the name of the theme you have downloaded.) Ensure the new theme folder and its contents are readable by the webserver.  Change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
=== How do I install a new theme when using cPanel? ===&lt;br /&gt;
&lt;br /&gt;
# Upload your new theme .zip file to your web server via cPanel. &lt;br /&gt;
# Then using cPanel install the new theme to your Moodle theme&#039;s folder.  The new theme will be installed into its own folder at /moodle/theme/[mytheme] (where [mytheme] is the name of your new theme.&lt;br /&gt;
# Ensure the new theme folder and its contents are readable by the webserver. If necessary  change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
=== Why is the new theme I uploaded not showing up in Theme Selector? ===&lt;br /&gt;
&lt;br /&gt;
# There could be a number of problems with the theme you uploaded, but one major problem reported in the Themes Forum all point to the way in which the theme is uploaded on certain servers. Using the cPanel method, as described in the previous section 1.1 [[How do I install a new theme when using cPanel?]](see above) will, in most cases, cure the problem.&lt;br /&gt;
&lt;br /&gt;
==How do I create a custom theme?==&lt;br /&gt;
&lt;br /&gt;
See [[Creating a custom theme]] and/or [[Make your own theme]].&lt;br /&gt;
&lt;br /&gt;
==Can I assign a specific theme to a course?==&lt;br /&gt;
&lt;br /&gt;
Yes. In the course settings, use the &amp;quot;Force theme&amp;quot; dropdown box.&lt;br /&gt;
&lt;br /&gt;
== Where shall I put my custom CSS code? ==&lt;br /&gt;
&lt;br /&gt;
Instead of modifying the theme&#039;s CSS files you better put your own code in a separate CSS file and make your theme aware of that file by modifying its config.php file (be sure add your own CSS file as the last one in the list so that you will override all prior settings). See this posting for [http://moodle.org/mod/forum/discuss.php?d=128599#p564055 detailed instructions]. &lt;br /&gt;
&lt;br /&gt;
See also the instructions on creating your own theme mentioned above.&lt;br /&gt;
&lt;br /&gt;
==How can I get the New Moodle2 theme for my site?==&lt;br /&gt;
Not til Moodle 2.x comes out and it will be a &amp;quot;sort of&amp;quot;.  The new look (refered to as &amp;quot;Moodle2&amp;quot;) for Moodle.org was made public just before the close of 2008. The Moodle2 look has various things hard coded into its fabric.   The good news is that many pieces of the look are available.&lt;br /&gt;
&lt;br /&gt;
==Will I lose my courses, language files, logo, etc. if I switch my theme?==&lt;br /&gt;
Switching themes only changes the appearance of your site, not the content within it. The logo is a part of the theme and will be lost when you switch.&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to [[Creating_a_custom_theme#Adding_a_Logo|add a logo]] to a theme.&lt;br /&gt;
&lt;br /&gt;
== Are there tools which help me creating and editing themes? ==&lt;br /&gt;
&lt;br /&gt;
=== Clear Cache Button ===&lt;br /&gt;
This useful Firefox add-on let&#039;s you add a button to your tool bar for easily clearing your cache while working on your theme: https://addons.mozilla.org/de/firefox/addon/1801&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;Please note that the following tools are only for development. They only change the way &#039;&#039;you&#039;&#039; see your Moodle site, not the Moodle site itself. Any changes you make using these tools will not be visible to anyone else who uses your site. For this you will have to make those changes permanent by changing your theme&#039;s CSS files for example.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firebug ===&lt;br /&gt;
The single most useful tool is the [[Development:Firebug|Firebug]] add-on for the [[Firefox]] web browser. Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page... And there are additional add-ons for making Firebug an even more powerful tool.&lt;br /&gt;
&lt;br /&gt;
==== Firebug enhancements ====&lt;br /&gt;
You can enhance Firebug even further. See [[Firebug]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Web Developer Toolbar ===&lt;br /&gt;
Another great tool for any web developer is the [[Web developer extension]], another Firefox add-on. One very useful feature is the option to &#039;&#039;&#039;disable your browser&#039;s cache&#039;&#039;&#039; while working on your theme. That way you are sure you&#039;re always presented with your latest modifications and not with an older, cached version.&lt;br /&gt;
&lt;br /&gt;
Now also available for Google&#039;s Chrome browser: [http://www.sitepoint.com/blogs/2010/03/23/chrome-web-developer-toolbar/ &amp;quot;The Web Developer Toolbar Comes to Chrome&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Stylish ===&lt;br /&gt;
Modifications made with Firebug are lost when refreshing your page. If you want your CSS changes to be a bit more permanent, for example to try them with different pages of your Moodle installation, you can use another Firefox plugin: [https://addons.mozilla.org/en-US/firefox/addon/2108 Stylish]. That way you can change your site&#039;s CSS with a simple mouse click without having to change Moodle code.&lt;br /&gt;
&lt;br /&gt;
See [[Stylish]] for detailed instructions and examples.&lt;br /&gt;
&lt;br /&gt;
== How do I check for cross-browser compatibility? ==&lt;br /&gt;
There are some tools (standalone and online) which can show you how your site looks in different browsers. See this [http://moodle.org/mod/forum/discuss.php?d=127746 forum discussion] for details.&lt;br /&gt;
&lt;br /&gt;
== Concrete examples for modifying Moodle themes ==&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
The following examples were taken from the former &#039;&#039;Theme Scrapbook&#039;&#039;:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;The Moodle &#039;&#039;&#039;Theme Scrapbook&#039;&#039;&#039; is a collection of small how-to descriptions. You theme designers and Moodle users working with themes add your knowledge here to help new Moodle users with tips and tricks for their theme work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Feel free to add to this list! Don&#039;t know how? Read our [[MoodleDocs:Guidelines_for_contributors|Guidelines for contributors]].&amp;quot;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing things ===&lt;br /&gt;
&lt;br /&gt;
==== Colors ====&lt;br /&gt;
* [[Forcing the colour of the chat discussion pane (pop-up mode)]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=142765 Changing background colour of a topic box]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=152357 How to change the colour of the popup event&#039;s header and background]&lt;br /&gt;
&lt;br /&gt;
==== Logo and icons ====&lt;br /&gt;
* [[Alternate Icon Set|Using an alternate icon set in Moodle]]&lt;br /&gt;
* [[Favicon|Change the favicon that shows in front of the web address]]&lt;br /&gt;
* [[Footer replacement|Replace the logo in the footer with your web address and/or or own logo]]&lt;br /&gt;
*[[Header logo|Replace the logo in the header]]&lt;br /&gt;
&lt;br /&gt;
==== Layout ====&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=136546 Overriding the $menu / $button variables] using PHP regular expressions in header.html&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=143411 Changing the view of course categories] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145077 Sub categories and courses layout] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=151370 Tracker &#039;components&#039; list too small]&lt;br /&gt;
&lt;br /&gt;
=== Adding things ===&lt;br /&gt;
* [[Header logo|Adding a logo to the theme header]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=157935 How to add a different img-bullet to each category?]&lt;br /&gt;
&lt;br /&gt;
=== Hiding things ===&lt;br /&gt;
* Hiding an element with CSS is generally achieved using the [http://reference.sitepoint.com/css/display display: none;] property on the element.&lt;br /&gt;
* See [[Print style]] and [[Stylish#Print style for Database records]] for an example how to hide parts of a page not meant for printing.&lt;br /&gt;
&lt;br /&gt;
=== Moving things ===&lt;br /&gt;
* [[Center Forum Posts|Centre smaller forum posts on the page]]&lt;br /&gt;
* [[Footer positioning|Positioning the page footer]]&lt;br /&gt;
* [[Left-align quiz|Left align quiz questions and answers]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=121847 Indentation for nested categories]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=128599 Positioning login and choose language field]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145179 Match question type - position answers nearer to the questions]&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous ===&lt;br /&gt;
* [[Fixed-width theme|Creating a fixed-width theme]]&lt;br /&gt;
* [[Homepage design|Homepage design of moodle.org]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=146763 Is there a way to fix oversized HTML Editor using CSS?]&lt;br /&gt;
&lt;br /&gt;
==How can I see theme changes when using the Windows Complete Installer package==&lt;br /&gt;
In the [http://download.moodle.org/windows/ Windows Complete Installer package], the eAccelerator in the XAMPP install can cause some issues with changes to your theme&#039;s CSS and HTML files from showing.&lt;br /&gt;
&lt;br /&gt;
Open the php.ini file inside of the server\php folder from your install in notepad and search for &amp;quot;eAccelerator&amp;quot; you should see a line that reads: &lt;br /&gt;
 extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Insert a semi-colon (turns the line into a comment) at the start of this line so it now reads: &lt;br /&gt;
 ;extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Restart the Moodle server using the &amp;quot;stop moodle&amp;quot; and then the &amp;quot;start moodle&amp;quot; programs in your server folder. You should now find that all of your changes to your CSS are reflected as soon as you save the file and refresh your browser cache (usually you can refresh your cache by pressing F5). This FAQ from a discussion at [http://moodle.org/mod/forum/discuss.php?d=151562#p663950 Deactivating caching with XAMPP installations]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?f=29 Themes forum]&lt;br /&gt;
* [[CSS FAQ]]&lt;br /&gt;
* [http://learn.open.ac.uk/mod/oublog/view.php?user=155976 &amp;quot;Understanding Moodle Themes&amp;quot;] - Blog post by [http://moodle.org/user/view.php?id=78896&amp;amp;course=5 Christopher Douce] (Open University)&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=149534 Testing 2.0. Use for modern vs old browsers] forum discussion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[de:Designs_FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=77475</id>
		<title>Themes FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=77475"/>
		<updated>2010-11-05T10:27:39Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* How do I install a new theme when using cPanel? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
==How do I install a new theme?==&lt;br /&gt;
&lt;br /&gt;
# Unzip the .zip file to an empty local directory.&lt;br /&gt;
# Upload folder to your web server to the /moodle/theme/[Theme Name]. (Replace [Theme Name] with the name of the theme you have downloaded.) Ensure the new theme folder and its contents are readable by the webserver.  Change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
=== How do I install a new theme when using cPanel? ===&lt;br /&gt;
&lt;br /&gt;
# Upload your new theme .zip file to your web server via cPanel. &lt;br /&gt;
# Then using cPanel install the new theme to your Moodle theme&#039;s folder.  The new theme will be installed into its own folder at /moodle/theme/[mytheme] (where [mytheme] is the name of your new theme.&lt;br /&gt;
# Ensure the new theme folder and its contents are readable by the webserver. If necessary  change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
=== Why is the new theme I uploaded not showing up in Theme Selector? ===&lt;br /&gt;
&lt;br /&gt;
# There could be a number of problems with the theme you uploaded, but one major problem reported in the Themes Forum all point to the way in which the theme is uploaded on certain servers. Using the cPanel method, as described in the previous section 1.1 (above) will, in most cases, cure the problem.&lt;br /&gt;
&lt;br /&gt;
==How do I create a custom theme?==&lt;br /&gt;
&lt;br /&gt;
See [[Creating a custom theme]] and/or [[Make your own theme]].&lt;br /&gt;
&lt;br /&gt;
==Can I assign a specific theme to a course?==&lt;br /&gt;
&lt;br /&gt;
Yes. In the course settings, use the &amp;quot;Force theme&amp;quot; dropdown box.&lt;br /&gt;
&lt;br /&gt;
== Where shall I put my custom CSS code? ==&lt;br /&gt;
&lt;br /&gt;
Instead of modifying the theme&#039;s CSS files you better put your own code in a separate CSS file and make your theme aware of that file by modifying its config.php file (be sure add your own CSS file as the last one in the list so that you will override all prior settings). See this posting for [http://moodle.org/mod/forum/discuss.php?d=128599#p564055 detailed instructions]. &lt;br /&gt;
&lt;br /&gt;
See also the instructions on creating your own theme mentioned above.&lt;br /&gt;
&lt;br /&gt;
==How can I get the New Moodle2 theme for my site?==&lt;br /&gt;
Not til Moodle 2.x comes out and it will be a &amp;quot;sort of&amp;quot;.  The new look (refered to as &amp;quot;Moodle2&amp;quot;) for Moodle.org was made public just before the close of 2008. The Moodle2 look has various things hard coded into its fabric.   The good news is that many pieces of the look are available.&lt;br /&gt;
&lt;br /&gt;
==Will I lose my courses, language files, logo, etc. if I switch my theme?==&lt;br /&gt;
Switching themes only changes the appearance of your site, not the content within it. The logo is a part of the theme and will be lost when you switch.&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to [[Creating_a_custom_theme#Adding_a_Logo|add a logo]] to a theme.&lt;br /&gt;
&lt;br /&gt;
== Are there tools which help me creating and editing themes? ==&lt;br /&gt;
&lt;br /&gt;
=== Clear Cache Button ===&lt;br /&gt;
This useful Firefox add-on let&#039;s you add a button to your tool bar for easily clearing your cache while working on your theme: https://addons.mozilla.org/de/firefox/addon/1801&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;Please note that the following tools are only for development. They only change the way &#039;&#039;you&#039;&#039; see your Moodle site, not the Moodle site itself. Any changes you make using these tools will not be visible to anyone else who uses your site. For this you will have to make those changes permanent by changing your theme&#039;s CSS files for example.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firebug ===&lt;br /&gt;
The single most useful tool is the [[Development:Firebug|Firebug]] add-on for the [[Firefox]] web browser. Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page... And there are additional add-ons for making Firebug an even more powerful tool.&lt;br /&gt;
&lt;br /&gt;
==== Firebug enhancements ====&lt;br /&gt;
You can enhance Firebug even further. See [[Firebug]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Web Developer Toolbar ===&lt;br /&gt;
Another great tool for any web developer is the [[Web developer extension]], another Firefox add-on. One very useful feature is the option to &#039;&#039;&#039;disable your browser&#039;s cache&#039;&#039;&#039; while working on your theme. That way you are sure you&#039;re always presented with your latest modifications and not with an older, cached version.&lt;br /&gt;
&lt;br /&gt;
Now also available for Google&#039;s Chrome browser: [http://www.sitepoint.com/blogs/2010/03/23/chrome-web-developer-toolbar/ &amp;quot;The Web Developer Toolbar Comes to Chrome&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Stylish ===&lt;br /&gt;
Modifications made with Firebug are lost when refreshing your page. If you want your CSS changes to be a bit more permanent, for example to try them with different pages of your Moodle installation, you can use another Firefox plugin: [https://addons.mozilla.org/en-US/firefox/addon/2108 Stylish]. That way you can change your site&#039;s CSS with a simple mouse click without having to change Moodle code.&lt;br /&gt;
&lt;br /&gt;
See [[Stylish]] for detailed instructions and examples.&lt;br /&gt;
&lt;br /&gt;
== How do I check for cross-browser compatibility? ==&lt;br /&gt;
There are some tools (standalone and online) which can show you how your site looks in different browsers. See this [http://moodle.org/mod/forum/discuss.php?d=127746 forum discussion] for details.&lt;br /&gt;
&lt;br /&gt;
== Concrete examples for modifying Moodle themes ==&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
The following examples were taken from the former &#039;&#039;Theme Scrapbook&#039;&#039;:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;The Moodle &#039;&#039;&#039;Theme Scrapbook&#039;&#039;&#039; is a collection of small how-to descriptions. You theme designers and Moodle users working with themes add your knowledge here to help new Moodle users with tips and tricks for their theme work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Feel free to add to this list! Don&#039;t know how? Read our [[MoodleDocs:Guidelines_for_contributors|Guidelines for contributors]].&amp;quot;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing things ===&lt;br /&gt;
&lt;br /&gt;
==== Colors ====&lt;br /&gt;
* [[Forcing the colour of the chat discussion pane (pop-up mode)]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=142765 Changing background colour of a topic box]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=152357 How to change the colour of the popup event&#039;s header and background]&lt;br /&gt;
&lt;br /&gt;
==== Logo and icons ====&lt;br /&gt;
* [[Alternate Icon Set|Using an alternate icon set in Moodle]]&lt;br /&gt;
* [[Favicon|Change the favicon that shows in front of the web address]]&lt;br /&gt;
* [[Footer replacement|Replace the logo in the footer with your web address and/or or own logo]]&lt;br /&gt;
*[[Header logo|Replace the logo in the header]]&lt;br /&gt;
&lt;br /&gt;
==== Layout ====&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=136546 Overriding the $menu / $button variables] using PHP regular expressions in header.html&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=143411 Changing the view of course categories] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145077 Sub categories and courses layout] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=151370 Tracker &#039;components&#039; list too small]&lt;br /&gt;
&lt;br /&gt;
=== Adding things ===&lt;br /&gt;
* [[Header logo|Adding a logo to the theme header]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=157935 How to add a different img-bullet to each category?]&lt;br /&gt;
&lt;br /&gt;
=== Hiding things ===&lt;br /&gt;
* Hiding an element with CSS is generally achieved using the [http://reference.sitepoint.com/css/display display: none;] property on the element.&lt;br /&gt;
* See [[Print style]] and [[Stylish#Print style for Database records]] for an example how to hide parts of a page not meant for printing.&lt;br /&gt;
&lt;br /&gt;
=== Moving things ===&lt;br /&gt;
* [[Center Forum Posts|Centre smaller forum posts on the page]]&lt;br /&gt;
* [[Footer positioning|Positioning the page footer]]&lt;br /&gt;
* [[Left-align quiz|Left align quiz questions and answers]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=121847 Indentation for nested categories]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=128599 Positioning login and choose language field]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145179 Match question type - position answers nearer to the questions]&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous ===&lt;br /&gt;
* [[Fixed-width theme|Creating a fixed-width theme]]&lt;br /&gt;
* [[Homepage design|Homepage design of moodle.org]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=146763 Is there a way to fix oversized HTML Editor using CSS?]&lt;br /&gt;
&lt;br /&gt;
==How can I see theme changes when using the Windows Complete Installer package==&lt;br /&gt;
In the [http://download.moodle.org/windows/ Windows Complete Installer package], the eAccelerator in the XAMPP install can cause some issues with changes to your theme&#039;s CSS and HTML files from showing.&lt;br /&gt;
&lt;br /&gt;
Open the php.ini file inside of the server\php folder from your install in notepad and search for &amp;quot;eAccelerator&amp;quot; you should see a line that reads: &lt;br /&gt;
 extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Insert a semi-colon (turns the line into a comment) at the start of this line so it now reads: &lt;br /&gt;
 ;extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Restart the Moodle server using the &amp;quot;stop moodle&amp;quot; and then the &amp;quot;start moodle&amp;quot; programs in your server folder. You should now find that all of your changes to your CSS are reflected as soon as you save the file and refresh your browser cache (usually you can refresh your cache by pressing F5). This FAQ from a discussion at [http://moodle.org/mod/forum/discuss.php?d=151562#p663950 Deactivating caching with XAMPP installations]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?f=29 Themes forum]&lt;br /&gt;
* [[CSS FAQ]]&lt;br /&gt;
* [http://learn.open.ac.uk/mod/oublog/view.php?user=155976 &amp;quot;Understanding Moodle Themes&amp;quot;] - Blog post by [http://moodle.org/user/view.php?id=78896&amp;amp;course=5 Christopher Douce] (Open University)&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=149534 Testing 2.0. Use for modern vs old browsers] forum discussion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[de:Designs_FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=77474</id>
		<title>Themes FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=77474"/>
		<updated>2010-11-05T10:26:00Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* How do I install a new theme? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
==How do I install a new theme?==&lt;br /&gt;
&lt;br /&gt;
# Unzip the .zip file to an empty local directory.&lt;br /&gt;
# Upload folder to your web server to the /moodle/theme/[Theme Name]. (Replace [Theme Name] with the name of the theme you have downloaded.) Ensure the new theme folder and its contents are readable by the webserver.  Change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
=== How do I install a new theme when using cPanel? ===&lt;br /&gt;
&lt;br /&gt;
# Upload your new theme .zip file to your web server via cPanel. &lt;br /&gt;
# Then using cPanel install the new theme to your Moodle theme&#039;s folder.  The new theme will be installed into its own folder at /moodle/theme/[mytheme] (where [mytheme] is the name of your new theme.&lt;br /&gt;
# Ensure the new theme folder and its contents are readable by the webserver. If necessary  change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
=== Why is the new theme I uploaded not showing up in Theme Selector?&lt;br /&gt;
&lt;br /&gt;
# There could be a number of problems with the theme you uploaded, but one major problem reported in the Themes Forum all point to the way in which the theme is uploaded on certain servers. Using the cPanel method, as described in the previous section 1.1 (above) will, in most cases, cure the problem.&lt;br /&gt;
&lt;br /&gt;
==How do I create a custom theme?==&lt;br /&gt;
&lt;br /&gt;
See [[Creating a custom theme]] and/or [[Make your own theme]].&lt;br /&gt;
&lt;br /&gt;
==Can I assign a specific theme to a course?==&lt;br /&gt;
&lt;br /&gt;
Yes. In the course settings, use the &amp;quot;Force theme&amp;quot; dropdown box.&lt;br /&gt;
&lt;br /&gt;
== Where shall I put my custom CSS code? ==&lt;br /&gt;
&lt;br /&gt;
Instead of modifying the theme&#039;s CSS files you better put your own code in a separate CSS file and make your theme aware of that file by modifying its config.php file (be sure add your own CSS file as the last one in the list so that you will override all prior settings). See this posting for [http://moodle.org/mod/forum/discuss.php?d=128599#p564055 detailed instructions]. &lt;br /&gt;
&lt;br /&gt;
See also the instructions on creating your own theme mentioned above.&lt;br /&gt;
&lt;br /&gt;
==How can I get the New Moodle2 theme for my site?==&lt;br /&gt;
Not til Moodle 2.x comes out and it will be a &amp;quot;sort of&amp;quot;.  The new look (refered to as &amp;quot;Moodle2&amp;quot;) for Moodle.org was made public just before the close of 2008. The Moodle2 look has various things hard coded into its fabric.   The good news is that many pieces of the look are available.&lt;br /&gt;
&lt;br /&gt;
==Will I lose my courses, language files, logo, etc. if I switch my theme?==&lt;br /&gt;
Switching themes only changes the appearance of your site, not the content within it. The logo is a part of the theme and will be lost when you switch.&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to [[Creating_a_custom_theme#Adding_a_Logo|add a logo]] to a theme.&lt;br /&gt;
&lt;br /&gt;
== Are there tools which help me creating and editing themes? ==&lt;br /&gt;
&lt;br /&gt;
=== Clear Cache Button ===&lt;br /&gt;
This useful Firefox add-on let&#039;s you add a button to your tool bar for easily clearing your cache while working on your theme: https://addons.mozilla.org/de/firefox/addon/1801&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;Please note that the following tools are only for development. They only change the way &#039;&#039;you&#039;&#039; see your Moodle site, not the Moodle site itself. Any changes you make using these tools will not be visible to anyone else who uses your site. For this you will have to make those changes permanent by changing your theme&#039;s CSS files for example.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firebug ===&lt;br /&gt;
The single most useful tool is the [[Development:Firebug|Firebug]] add-on for the [[Firefox]] web browser. Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page... And there are additional add-ons for making Firebug an even more powerful tool.&lt;br /&gt;
&lt;br /&gt;
==== Firebug enhancements ====&lt;br /&gt;
You can enhance Firebug even further. See [[Firebug]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Web Developer Toolbar ===&lt;br /&gt;
Another great tool for any web developer is the [[Web developer extension]], another Firefox add-on. One very useful feature is the option to &#039;&#039;&#039;disable your browser&#039;s cache&#039;&#039;&#039; while working on your theme. That way you are sure you&#039;re always presented with your latest modifications and not with an older, cached version.&lt;br /&gt;
&lt;br /&gt;
Now also available for Google&#039;s Chrome browser: [http://www.sitepoint.com/blogs/2010/03/23/chrome-web-developer-toolbar/ &amp;quot;The Web Developer Toolbar Comes to Chrome&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Stylish ===&lt;br /&gt;
Modifications made with Firebug are lost when refreshing your page. If you want your CSS changes to be a bit more permanent, for example to try them with different pages of your Moodle installation, you can use another Firefox plugin: [https://addons.mozilla.org/en-US/firefox/addon/2108 Stylish]. That way you can change your site&#039;s CSS with a simple mouse click without having to change Moodle code.&lt;br /&gt;
&lt;br /&gt;
See [[Stylish]] for detailed instructions and examples.&lt;br /&gt;
&lt;br /&gt;
== How do I check for cross-browser compatibility? ==&lt;br /&gt;
There are some tools (standalone and online) which can show you how your site looks in different browsers. See this [http://moodle.org/mod/forum/discuss.php?d=127746 forum discussion] for details.&lt;br /&gt;
&lt;br /&gt;
== Concrete examples for modifying Moodle themes ==&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
The following examples were taken from the former &#039;&#039;Theme Scrapbook&#039;&#039;:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;The Moodle &#039;&#039;&#039;Theme Scrapbook&#039;&#039;&#039; is a collection of small how-to descriptions. You theme designers and Moodle users working with themes add your knowledge here to help new Moodle users with tips and tricks for their theme work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Feel free to add to this list! Don&#039;t know how? Read our [[MoodleDocs:Guidelines_for_contributors|Guidelines for contributors]].&amp;quot;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing things ===&lt;br /&gt;
&lt;br /&gt;
==== Colors ====&lt;br /&gt;
* [[Forcing the colour of the chat discussion pane (pop-up mode)]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=142765 Changing background colour of a topic box]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=152357 How to change the colour of the popup event&#039;s header and background]&lt;br /&gt;
&lt;br /&gt;
==== Logo and icons ====&lt;br /&gt;
* [[Alternate Icon Set|Using an alternate icon set in Moodle]]&lt;br /&gt;
* [[Favicon|Change the favicon that shows in front of the web address]]&lt;br /&gt;
* [[Footer replacement|Replace the logo in the footer with your web address and/or or own logo]]&lt;br /&gt;
*[[Header logo|Replace the logo in the header]]&lt;br /&gt;
&lt;br /&gt;
==== Layout ====&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=136546 Overriding the $menu / $button variables] using PHP regular expressions in header.html&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=143411 Changing the view of course categories] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145077 Sub categories and courses layout] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=151370 Tracker &#039;components&#039; list too small]&lt;br /&gt;
&lt;br /&gt;
=== Adding things ===&lt;br /&gt;
* [[Header logo|Adding a logo to the theme header]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=157935 How to add a different img-bullet to each category?]&lt;br /&gt;
&lt;br /&gt;
=== Hiding things ===&lt;br /&gt;
* Hiding an element with CSS is generally achieved using the [http://reference.sitepoint.com/css/display display: none;] property on the element.&lt;br /&gt;
* See [[Print style]] and [[Stylish#Print style for Database records]] for an example how to hide parts of a page not meant for printing.&lt;br /&gt;
&lt;br /&gt;
=== Moving things ===&lt;br /&gt;
* [[Center Forum Posts|Centre smaller forum posts on the page]]&lt;br /&gt;
* [[Footer positioning|Positioning the page footer]]&lt;br /&gt;
* [[Left-align quiz|Left align quiz questions and answers]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=121847 Indentation for nested categories]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=128599 Positioning login and choose language field]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145179 Match question type - position answers nearer to the questions]&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous ===&lt;br /&gt;
* [[Fixed-width theme|Creating a fixed-width theme]]&lt;br /&gt;
* [[Homepage design|Homepage design of moodle.org]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=146763 Is there a way to fix oversized HTML Editor using CSS?]&lt;br /&gt;
&lt;br /&gt;
==How can I see theme changes when using the Windows Complete Installer package==&lt;br /&gt;
In the [http://download.moodle.org/windows/ Windows Complete Installer package], the eAccelerator in the XAMPP install can cause some issues with changes to your theme&#039;s CSS and HTML files from showing.&lt;br /&gt;
&lt;br /&gt;
Open the php.ini file inside of the server\php folder from your install in notepad and search for &amp;quot;eAccelerator&amp;quot; you should see a line that reads: &lt;br /&gt;
 extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Insert a semi-colon (turns the line into a comment) at the start of this line so it now reads: &lt;br /&gt;
 ;extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Restart the Moodle server using the &amp;quot;stop moodle&amp;quot; and then the &amp;quot;start moodle&amp;quot; programs in your server folder. You should now find that all of your changes to your CSS are reflected as soon as you save the file and refresh your browser cache (usually you can refresh your cache by pressing F5). This FAQ from a discussion at [http://moodle.org/mod/forum/discuss.php?d=151562#p663950 Deactivating caching with XAMPP installations]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?f=29 Themes forum]&lt;br /&gt;
* [[CSS FAQ]]&lt;br /&gt;
* [http://learn.open.ac.uk/mod/oublog/view.php?user=155976 &amp;quot;Understanding Moodle Themes&amp;quot;] - Blog post by [http://moodle.org/user/view.php?id=78896&amp;amp;course=5 Christopher Douce] (Open University)&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=149534 Testing 2.0. Use for modern vs old browsers] forum discussion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[de:Designs_FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=error/moodle/secretalreadyused&amp;diff=75545</id>
		<title>error/moodle/secretalreadyused</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=error/moodle/secretalreadyused&amp;diff=75545"/>
		<updated>2010-09-07T19:48:35Z</updated>

		<summary type="html">&lt;p&gt;Tqr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I suppose you have arrive at this page from some area of Moodle where you dared to click the HELP button in the vain hope you would arrive at a page which would explain the cryptic message [[Change password confirmation link was already used, password was not changed.]] &lt;br /&gt;
&lt;br /&gt;
Well you have...DON&#039;T CLICK THE LINK!&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=error/moodle/secretalreadyused&amp;diff=75544</id>
		<title>error/moodle/secretalreadyused</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=error/moodle/secretalreadyused&amp;diff=75544"/>
		<updated>2010-09-07T19:46:29Z</updated>

		<summary type="html">&lt;p&gt;Tqr: New page: I suppose you have arrive at this page from some area of Moodle where you dared to click the HELP button in the vain hope you would arrive at a page which would explain the cryptic message...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I suppose you have arrive at this page from some area of Moodle where you dared to click the HELP button in the vain hope you would arrive at a page which would explain the cryptic message [[Change password confirmation link was already used, password was not changed.]] &lt;br /&gt;
&lt;br /&gt;
Well you have...&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_adding_a_settings_page&amp;diff=72897</id>
		<title>Development:Themes 2.0 adding a settings page</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Themes_2.0_adding_a_settings_page&amp;diff=72897"/>
		<updated>2010-06-11T13:00:49Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* Creating a language file and adding our strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.0}}This document looks at how to create a settings page for your theme and how to make use of those settings within the CSS and layout files for your theme.&lt;br /&gt;
&lt;br /&gt;
This is a pretty advanced topic and will require that you have at least an intermediate knowledge of PHP, CSS, and development in general.&lt;br /&gt;
&lt;br /&gt;
==Before we begin==&lt;br /&gt;
[[Image:Theme.settings.page.03.png|350px|thumb|Our end goal. The settings page.]]&lt;br /&gt;
[[Image:Theme.settings.page.10.png|350px|thumb|And what it can do.]]&lt;br /&gt;
There is a huge body of knowledge that we must cover in following through this document and as such I think the best way to write this is as a tutorial.&lt;br /&gt;
&lt;br /&gt;
My intentions for this tutorial are to replicate the standard theme but with a settings page that allows the administrator to set a background colour, set a logo to use with the page, and probably several other minor settings to change the way in which the theme is displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will start this tutorial by creating a new theme which will be largely a copy/paste of the current standard theme. I expect that anyone working through this tutorial has previously read the tutorial I wrote on [[Development:Themes 2.0 creating your first theme|creating your first theme]]. If you haven&#039;t go read it now because I&#039;m not going to go into much detail until we get to the actual process of customising the theme and introducing the settings page.&lt;br /&gt;
&lt;br /&gt;
So before we finally get this started please ensure you can check off everything on the following requirements list.&lt;br /&gt;
* Have a Moodle installation that has already been installed and configured and is ready to use.&lt;br /&gt;
* Have full read/write access to that installation.&lt;br /&gt;
* Be prepared to delete that installation at the end of this... we will destroy it!&lt;br /&gt;
* Have a development environment prepared and ready to use. This includes:&lt;br /&gt;
** Your favourite editor installed, running, and pointed at the themes directory of your installation.&lt;br /&gt;
** Your browser open and your site visible.&lt;br /&gt;
** A bottomless coffee pot... decaf won&#039;t help you with this one.&lt;br /&gt;
* Have turned on theme designer mode, if you don&#039;t know what this is please read the [[Development:Themes 2.0 creating your first theme|creating your first theme]] tutorial.&lt;br /&gt;
* Have turned on allowthemechangeonurl. This setting allows you to change themes on the URL and is very handy when developing themes.&lt;br /&gt;
* And finally an insane ambition to create a customisable theme.&lt;br /&gt;
&lt;br /&gt;
For those interested the theme that I create throughout this tutorial can be downloaded from the forum post in which I announce this document: http://moodle.org/mod/forum/discuss.php?d=152053&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Our goals for this tutorial==&lt;br /&gt;
The following is just a list goals that I hope to achieve during this tutorial. They are laid out here so that I can easily refer back to them and so that you can easily find them.&lt;br /&gt;
# Create a new theme called &#039;&#039;&#039;demystified&#039;&#039;&#039; based upon the standard theme within Moodle 2.0.&lt;br /&gt;
# Make some minor changes to that theme to allow us to more easily see what is going on.&lt;br /&gt;
# Create a settings page for the demystified theme.&lt;br /&gt;
# Add several settings to our settings page.&lt;br /&gt;
# Use some of those settings to alter our CSS.&lt;br /&gt;
# Use the rest of those settings within our layout file..&lt;br /&gt;
# Discuss the good, the bad, and limits of what we have just created.&lt;br /&gt;
&lt;br /&gt;
So I can see you are all very excited about this point and that you would love to know what settings we are going to create; So here they are:&lt;br /&gt;
&lt;br /&gt;
A setting to ...&lt;br /&gt;
* change the background colour (CSS).&lt;br /&gt;
* set the path to an image that we will use as a logo on all pages (Layout files).&lt;br /&gt;
* override the width of the block regions (CSS).&lt;br /&gt;
* allow a note to be added to the footer of all pages (Layout files).&lt;br /&gt;
* allow custom CSS to be written to do anything the user wants. (CSS)&lt;br /&gt;
&lt;br /&gt;
==Creating the demystified theme==&lt;br /&gt;
Before we start here I want to remind you that I am going to look at this only briefly as I am making the assumption that you have read the [[Development:Themes 2.0 creating your first theme|creating your first theme]] tutorial.&lt;br /&gt;
&lt;br /&gt;
Well lets get into it....&lt;br /&gt;
&lt;br /&gt;
The first thing we need to do is create a directory for our theme which we will call demystified. &lt;br /&gt;
&lt;br /&gt;
So within your Moodle directory create the following folder &#039;&#039;&#039;moodle/theme/demystified&#039;&#039;&#039;. At the same time you can also create the following files and folders which we will get to soon.&lt;br /&gt;
* The file &#039;&#039;&#039;moodle/theme/demystified/config.php&#039;&#039;&#039; for our config information.&lt;br /&gt;
* The directory &#039;&#039;&#039;moodle/theme/demystified/layout&#039;&#039;&#039; for our layout files.&lt;br /&gt;
* The directory &#039;&#039;&#039;moodle/theme/demystified/style&#039;&#039;&#039; for our css files.&lt;br /&gt;
* The file &#039;&#039;&#039;moodle/theme/demystified/style/core.css&#039;&#039;&#039; which will contain our special CSS.&lt;br /&gt;
&lt;br /&gt;
Next we will copy the layout files from the base theme to our new theme demystified. We are basing the demystified theme on the standard theme however that doesn&#039;t use it&#039;s own layout files it uses the base theme&#039;s layout files so those are the ones we want. &lt;br /&gt;
&lt;br /&gt;
The reason that we are coping these layout files is that later on in this tutorial we will be modifying them to make use of our new settings... so copy all of the layout files from &#039;&#039;&#039;moodle/theme/base/layout&#039;&#039;&#039; to &#039;&#039;&#039;moodle/theme/demystified/layout&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
There should be three files that you just copied:&lt;br /&gt;
# embedded.php&lt;br /&gt;
# frontpage.php&lt;br /&gt;
# general.php&lt;br /&gt;
&lt;br /&gt;
Now we need to populate demystified/config.php with the settings for our new theme. They are as follows:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;demystified&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Simply sets the name of our theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;parents = array(&#039;standard&#039;,&#039;base&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This theme is extending both the standard theme and the base theme. Remember when extending a theme you also need to extend its parents or things might not work correctly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&#039;core&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This tells our theme that we want to use the file &#039;&#039;&#039;demystified/style/core.css&#039;&#039;&#039; with this theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;height:300px;overflow-y:scroll;&amp;quot;&amp;gt;&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-post&#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-post&#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-post&#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-post&#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-post&#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-post&#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-post&#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),&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),&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),&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),&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Now that all looks very complicated however its really not too bad as it is just copied from the base theme&#039;s config.php file. We can do this because we copied the layout files from the base theme to begin with and for the time being there are no changes that we wish to make. Simply open up &#039;&#039;&#039;theme/base/config.php&#039;&#039;&#039; and copy the layouts from there.&lt;br /&gt;
&lt;br /&gt;
And that is it. The config.php file for our demystified theme is complete. The full source is shown below:&lt;br /&gt;
&amp;lt;div style=&amp;quot;height:300px;overflow-y:scroll;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * The demystified theme config file&lt;br /&gt;
 *&lt;br /&gt;
 * This theme was created to document the process of adding a settings page to a theme&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright 2010 Sam Hemelryk&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// The name of our theme&lt;br /&gt;
$THEME-&amp;gt;name = &#039;demystified&#039;;&lt;br /&gt;
&lt;br /&gt;
// The other themes this theme extends&lt;br /&gt;
$THEME-&amp;gt;parents = array(&#039;standard&#039;,&#039;base&#039;);&lt;br /&gt;
&lt;br /&gt;
// The CSS files this theme uses (located in the style directory)&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&#039;core&#039;);&lt;br /&gt;
&lt;br /&gt;
// The layout definitions for this theme&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-post&#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-post&#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-post&#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-post&#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-post&#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-post&#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-post&#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),&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),&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),&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),&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows both the directory structure we have now created and the theme presently.&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.01.png]]&lt;br /&gt;
&lt;br /&gt;
To view the theme so far open you browser and enter the URL of your site followed by &#039;&#039;&#039;?theme=demystified&#039;&#039;&#039;. You should see the theme that we just created which will look exactly like the base standard theme.&lt;br /&gt;
&lt;br /&gt;
The final thing that we want to do is add a little bit of CSS to the demystified theme that will both visually set this theme apart from the standard theme and second build a the base which our settings can later extend.&lt;br /&gt;
&lt;br /&gt;
I added the following snippet of CSS to the file &#039;&#039;&#039;demystified/style/core.css&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
html {background-color:#DDD;}&lt;br /&gt;
body {margin:30px;padding:0;border:1px solid #333;border-width:0 10px 0 10px;background-color:#333;}&lt;br /&gt;
body #page {background-color:#FFF;position:relative;top:-10px;}&lt;br /&gt;
.block .header {background-image:none;background-color:#0C5CAC;border:1px solid #0C5CAC;color:#FFF;}&lt;br /&gt;
.block {border-color:#4BA7FF;background-color:#DDEEFF;}&lt;br /&gt;
.block .content {background-color:#F1F8FF;}&lt;br /&gt;
a:link,&lt;br /&gt;
a:visited {color:#0C5CAC;}&lt;br /&gt;
a:hover {color:#C77500;}&lt;br /&gt;
#page #page-header {background-color:#0C5CAC;margin:0;padding:0;width:100%;color:#fff;}&lt;br /&gt;
#page #page-header a:link, #page #page-header a:visited {color:#FFAC02}&lt;br /&gt;
#page #page-header .navbar, #page #page-header .navbar a:link, #page #page-header .navbar a:visited {color:#0C5CAC;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CSS that we have just added to our theme sets a couple of colours on the front page. Presently this is the only CSS I will add, I know it isn&#039;t complete by any means but it achieves it&#039;s purpose as the screenshot below illustrates.&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.02.png|715px|thumb|left|The newly styles demystified theme]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that I will move on to the real purpose of this tutorial, creating the settings page&lt;br /&gt;
&lt;br /&gt;
==Setting up the settings page==&lt;br /&gt;
With the demystified theme set up it is time to create the settings page. This is where the real PHP fun begins.&lt;br /&gt;
&lt;br /&gt;
For those of you who happen to be familiar with development of modules, blocks or other plugin types you have probably encountered settings pages before and this is not going to be any different.&lt;br /&gt;
&lt;br /&gt;
However for those who haven&#039;t which I imagine is most of you this is going to be quite a challenge. I will try to walk through this step by step however if at any point you get stuck don&#039;t hesitate to ask in the forums as I imagine you will get a speedy response.&lt;br /&gt;
&lt;br /&gt;
===How settings pages work in Moodle===&lt;br /&gt;
Settings pages can be used by nearly every plugin type, of which themes is of course one. The way in which it all works isn&#039;t too tricky to understand. &lt;br /&gt;
&lt;br /&gt;
All of the settings for Moodle can be configured through the administrator interfaces when logged in. I am sure that everyone here has seen those pages and has changed a setting or two before so you will all know what I am talking about. Well the settings page for a theme is no different. It will be shown in the administration pages tree under &#039;&#039;&#039;Appearance &amp;gt; Themes&#039;&#039;&#039; and all we have to do is tell Moodle what settings there are.&lt;br /&gt;
&lt;br /&gt;
This is done by creating a settings.php file within out theme into which we will add code that tells Moodle about the settings we want to add/use.&lt;br /&gt;
&lt;br /&gt;
When telling Moodle about each setting we are simply creating a new &#039;&#039;admin_setting&#039;&#039; instance of the type we want and the properties we want and then adding it to our settings page.&lt;br /&gt;
&lt;br /&gt;
There is really not much more too it at this level. Things can get very complex very fast so the best thing we can do now is start creating our settings.php file for the demystified theme and see where it leads us.&lt;br /&gt;
&lt;br /&gt;
===Creating the settings page===&lt;br /&gt;
So as mentioned before we need a settings.php file which we will create now. To begin with create the file &#039;&#039;&#039;theme/demystified/settings.php&#039;&#039;&#039; and open it in your favourite editor so its ready to go.&lt;br /&gt;
&lt;br /&gt;
Before we start adding code however lets just remember the settings that we want to create:&lt;br /&gt;
* change the background colour (CSS).&lt;br /&gt;
* set the path to an image that we will use as a logo on all pages (Layout files).&lt;br /&gt;
* override the width of the block regions (CSS).&lt;br /&gt;
* allow a note to be added to the footer of all pages (Layout files).&lt;br /&gt;
* allow custom CSS to be written to do anything the user wants. (CSS)&lt;br /&gt;
&lt;br /&gt;
Alright.&lt;br /&gt;
&lt;br /&gt;
Now thinking about this the first setting is as basic as it gets, all we need is a text box that the user can type a colour into.&lt;br /&gt;
&lt;br /&gt;
The second is to allow a logo to be used in the header of each page. What we want here is a path but should it be a physical path e.g. C:/path/to/image.png or should it be a web path e.g. &amp;lt;nowiki&amp;gt;http://mysite.com/path/to/image.png&amp;lt;/nowiki&amp;gt;?&lt;br /&gt;
For the purpose of this tutorial I am going to go with a web path because it is going to be easier to code and will hopefully be a little easier to understand to begin with.&lt;br /&gt;
&lt;br /&gt;
The third setting is a little more complex. For this I want a drop down box with some specific widths that the administrator can select.&lt;br /&gt;
&lt;br /&gt;
The forth and the fifth settings are both pretty straight forward, there we want a textarea into which the user can enter what ever they want and we will do something useful with it.&lt;br /&gt;
&lt;br /&gt;
Now that we have an understanding about the settings we wish to define pull up your editor and lets start coding....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Settings for the demystified theme&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$temp = new admin_settingpage(&#039;theme_demystified&#039;, get_string(&#039;configtitle&#039;,&#039;theme_demystified&#039;));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is the first bit of code we must enter, the first line is of course just the opening php tag, secondly we have a comment that describes this file, and then we get create a new &#039;&#039;&#039;admin_settingspage object&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This admin_settingspage object that we have just created is a representation of our settings page and is the what we add our new settings to. When creating it we give it two arguments, first the name of the page which is in this case &#039;&#039;&#039;theme_&#039;&#039;themename&#039;&#039;&#039;&#039;&#039; and the title for the page which we get with the get_string method.&lt;br /&gt;
&lt;br /&gt;
At the moment I&#039;m not going to worry about adding the string, we will get to that later once we have defined all of our settings.&lt;br /&gt;
&lt;br /&gt;
====Background colour====&lt;br /&gt;
&lt;br /&gt;
With the page now created as &#039;&#039;$temp&#039;&#039; lets add our first setting: Background colour.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Background colour setting&lt;br /&gt;
$name = &#039;theme_demystified/backgroundcolor&#039;;&lt;br /&gt;
$title = get_string(&#039;backgroundcolor&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;backgroundcolordesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = &#039;#DDD&#039;;&lt;br /&gt;
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_CLEAN, 12);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Thankfully this isn&#039;t as difficult as it initially looks.&lt;br /&gt;
&lt;br /&gt;
The first line of code is creating a variable for the name of the background colour setting. In this case it is &#039;&#039;&#039;theme_demystified/backgroundcolor&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The name is very important, for the setting to be usable we have to follow a strict naming convention. &#039;&#039;&#039;theme_&#039;&#039;themename&#039;&#039;/&#039;&#039;settingname&#039;&#039;&#039;&#039;&#039; where &#039;&#039;&#039;&#039;&#039;themename&#039;&#039;&#039;&#039;&#039; is the name of the theme the setting belongs to and &#039;&#039;&#039;&#039;&#039;settingname&#039;&#039;&#039;&#039;&#039; is the name for the setting by which we will use it.&lt;br /&gt;
&lt;br /&gt;
The second line of code creates a variable that contains the title of the setting. This is what the user sees to the right of the setting on the settings page and should be a short description of the setting. Here we are again using the &#039;&#039;get_string&#039;&#039; method so we will need to remember to add that string later on.&lt;br /&gt;
&lt;br /&gt;
The third line of code sets the description. This should describe what the setting does or how it works and again we will use the get_string method.&lt;br /&gt;
&lt;br /&gt;
The fourth line creates a variable that will be used as the default value for the setting. Because this setting is a colour we want an HTML colour to be the default value.&lt;br /&gt;
&lt;br /&gt;
The fifth line is where we put it all together. Here we create a new &#039;&#039;&#039;admin_setting_configtext&#039;&#039;&#039; object. This object will represent the background colour setting.&lt;br /&gt;
&lt;br /&gt;
When we create it we need to give it 6 different things.&lt;br /&gt;
# The name of the setting. In this case we have a variable &#039;&#039;&#039;$name&#039;&#039;&#039;.&lt;br /&gt;
# The title for this setting. We used the variable &#039;&#039;&#039;$title&#039;&#039;&#039;.&lt;br /&gt;
# The description of the setting &#039;&#039;&#039;$description&#039;&#039;&#039;.&lt;br /&gt;
# The default value for the setting. &#039;&#039;&#039;$default&#039;&#039;&#039; is the variable this.&lt;br /&gt;
# The type of value we want the user to enter. For this we have used PARAM_CLEAN which tells Moodle to get rid of any nasties from what the user enters.&lt;br /&gt;
# The size of the field. In our case 12 characters will be plenty.&lt;br /&gt;
&lt;br /&gt;
The sixth and final line of code adds our newly created setting to the administration page we created earlier.&lt;br /&gt;
&lt;br /&gt;
That is it we have successfully created and added our first setting, however there are several more to settings to do, and there are a couple of important things that you need to be aware of before we move on.&lt;br /&gt;
&lt;br /&gt;
First: There are several different types of settings that you can create and add to a page, and each one may differ in what they need you to give them. In this case it was name, title, description, default, type, and size. However other settings will likely require different things. Smart editors like Netbeans or Eclipse can tell you what is required, otherwise you will need to research it.&lt;br /&gt;
&lt;br /&gt;
Second: Normally settings are declared on one line as follows:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$temp-&amp;gt;add(new admin_setting_configtext(&#039;theme_demystified/backgroundcolor&#039;, get_string(&#039;backgroundcolor&#039;,&#039;theme_demystified&#039;), get_string(&#039;backgroundcolordesc&#039;, &#039;theme_demystified&#039;), &#039;#DDD&#039;, PARAM_CLEAN, 12));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
While this is structurally identical as all we have done is move everything onto one line and do away with the variables it is a little harder to read when you are learning all of this.&lt;br /&gt;
&lt;br /&gt;
====The logo file====&lt;br /&gt;
Time to create the second setting that will allow the user to enter a URL to an image they wish to use as the logo on their site.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Logo file setting&lt;br /&gt;
$name = &#039;theme_demystified/logo&#039;;&lt;br /&gt;
$title = get_string(&#039;logo&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;logodesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_configtext($name, $title, $description, &#039;&#039;, PARAM_URL);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first thing that you will notice about this setting that it is very similar to the first setting, in fact all we have changed is the name, title, description, and default value. We have however changed the value type from PARAM_CLEAN to PARAM_URL, this makes sure the user enters a URL. You will also notice that for this one we don&#039;t set a size for the field as we have no idea how long the URL will be.&lt;br /&gt;
&lt;br /&gt;
====Block region width====&lt;br /&gt;
The third setting should allow the user to set a width for the block regions that will be used as columns.&lt;br /&gt;
&lt;br /&gt;
For this setting I want to do something a little different from the previous two, here I want to use a select box so that the user selects a width for the column from a list I provide.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Block region width&lt;br /&gt;
$name = &#039;theme_demystified/regionwidth&#039;;&lt;br /&gt;
$title = get_string(&#039;regionwidth&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;regionwidthdesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = 200;&lt;br /&gt;
$choices = array(150=&amp;gt;&#039;150px&#039;, 170=&amp;gt;&#039;170px&#039;, 200=&amp;gt;&#039;200px&#039;, 240=&amp;gt;&#039;240px&#039;, 290=&amp;gt;&#039;290px&#039;, 350=&amp;gt;&#039;350px&#039;, 420=&amp;gt;&#039;420px&#039;);&lt;br /&gt;
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
So looking at the code: The first four lines you will recognise. $name, $title, $description, and $default are all being set.&lt;br /&gt;
&lt;br /&gt;
The fifth line of code however introduces something new. Of course in order to have a select box we have to have options, in this case we have an array of options stored in the variable $choices.&lt;br /&gt;
&lt;br /&gt;
The array of options is constructed of a collection of &#039;&#039;&#039;&#039;&#039;value&#039;&#039;&#039; =&amp;gt; &#039;&#039;&#039;label&#039;&#039;&#039;&#039;&#039; pairs. Notice how we don&#039;t add &#039;&#039;&#039;px&#039;&#039;&#039; to the value. This is is very intentional as later on I need to do a little bit of math with that value so we need it to be a number.&lt;br /&gt;
&lt;br /&gt;
The lines after should look familiar again, the only difference being that instead of a &#039;&#039;admin_setting_configtext&#039;&#039; setting we have created a &#039;&#039;admin_setting_configselect&#039;&#039; for which we must give the choices for the select box as the fifth argument.&lt;br /&gt;
&lt;br /&gt;
Woohoo, we&#039;ve just created our first select box setting.&lt;br /&gt;
&lt;br /&gt;
====Foot note====&lt;br /&gt;
Now to create the foot note setting. Here we want the user to be able to enter some arbitrary text that will be used in the footer of the page. For this I want the user to be able to enter some HTML so I will create an editor setting.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Foot note setting&lt;br /&gt;
$name = &#039;theme_demystified/footnote&#039;;&lt;br /&gt;
$title = get_string(&#039;footnote&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;footnotedesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_confightmleditor($name, $title, $description, &#039;&#039;);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
How simple is that!&lt;br /&gt;
&lt;br /&gt;
It is just about identical to the first two settings except that for this we have created a &#039;&#039;admin_setting_confightmleditor&#039;&#039; setting rather than a text setting.&lt;br /&gt;
&lt;br /&gt;
Note: You can also set the columns and rows for the editor setting using the fifth and sixth arguments.&lt;br /&gt;
&lt;br /&gt;
====Custom CSS====&lt;br /&gt;
The final setting is to allow the user to add some custom CSS to the theme that will be used on every page. I want this to be a plain textarea into which the user can enter CSS.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Custom CSS file&lt;br /&gt;
$name = &#039;theme_demystified/customcss&#039;;&lt;br /&gt;
$title = get_string(&#039;customcss&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;customcssdesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_configtextarea($name, $title, $description, &#039;&#039;);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Just like the editor or text settings. It&#039;s getting very easy now!&lt;br /&gt;
&lt;br /&gt;
====Finishing settings.php====&lt;br /&gt;
With all of our settings defined and added to our page that we created right at the beginning it is time to finish it all off.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Add our page to the structure of the admin tree&lt;br /&gt;
$ADMIN-&amp;gt;add(&#039;themes&#039;, $temp);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above line of code is the final line for the page. It is adding the page that we have created &#039;&#039;&#039;$temp&#039;&#039;&#039; to the admin tree structure. In this case it is adding it to the themes branch.&lt;br /&gt;
&lt;br /&gt;
The following is the completed source for our settings.php ..... for your copy/paste pleasure.&lt;br /&gt;
&amp;lt;div style=&#039;height:300px;overflow:auto;&#039;&amp;gt;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Settings for the demystified theme&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// Create our admin page&lt;br /&gt;
$temp = new admin_settingpage(&#039;theme_demystified&#039;, get_string(&#039;configtitle&#039;,&#039;theme_demystified&#039;));&lt;br /&gt;
&lt;br /&gt;
// Background colour setting&lt;br /&gt;
$name = &#039;theme_demystified/backgroundcolor&#039;;&lt;br /&gt;
$title = get_string(&#039;backgroundcolor&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;backgroundcolordesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = &#039;#DDD&#039;;&lt;br /&gt;
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_CLEAN, 12);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Logo file setting&lt;br /&gt;
$name = &#039;theme_demystified/logo&#039;;&lt;br /&gt;
$title = get_string(&#039;logo&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;logodesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_configtext($name, $title, $description, &#039;&#039;, PARAM_URL);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Block region width&lt;br /&gt;
$name = &#039;theme_demystified/regionwidth&#039;;&lt;br /&gt;
$title = get_string(&#039;regionwidth&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;regionwidthdesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = 200;&lt;br /&gt;
$choices = array(150, 170, 200, 240, 290, 350, 420);&lt;br /&gt;
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Foot note setting&lt;br /&gt;
$name = &#039;theme_demystified/footnote&#039;;&lt;br /&gt;
$title = get_string(&#039;footnote&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;footnotedesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_confightmleditor($name, $title, $description, &#039;&#039;);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Custom CSS file&lt;br /&gt;
$name = &#039;theme_demystified/customcss&#039;;&lt;br /&gt;
$title = get_string(&#039;customcss&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;customcssdesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_configtextarea($name, $title, $description, &#039;&#039;);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Add our page to the structure of the admin tree&lt;br /&gt;
$ADMIN-&amp;gt;add(&#039;themes&#039;, $temp);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating a language file and adding our strings===&lt;br /&gt;
As I&#039;m sure none of you have forgotten, throughout the creation of the our settings.php page, we used a lot of strings that I mentioned we would set later on. Well now is the time to set those strings.&lt;br /&gt;
&lt;br /&gt;
First up create the following directories and file for our language strings:&lt;br /&gt;
* Directory &#039;&#039;&#039;theme/demystified/lang&#039;&#039;&#039;&lt;br /&gt;
* Directory &#039;&#039;&#039;theme/demystified/lang/en&#039;&#039;&#039;&lt;br /&gt;
* File &#039;&#039;&#039;theme/demystified/lang/theme_demystified.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
What we have created here is the required structure for Moodle to start looking for language strings.&lt;br /&gt;
&lt;br /&gt;
First Moodle locates the lang directory, once found it looks within that directory for another directory that uses the character code for the language the user has selected, by default this is &#039;&#039;&#039;en&#039;&#039;&#039; for English. Once that is found it looks for the appropriate language file, in this case &#039;&#039;&#039;theme_demystified.php&#039;&#039;&#039; from which it will load all language strings for our theme.&lt;br /&gt;
&lt;br /&gt;
If English isn&#039;t your chosen language simply replace the &#039;&#039;en&#039;&#039; directory with one that uses your chosen languages character code (two letters).&lt;br /&gt;
&lt;br /&gt;
We can now add our language strings to &#039;&#039;&#039;theme/demystified/lang/theme_demystified.php&#039;&#039;&#039;. Copy and paste the following lines of PHP into this file.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * This file contains the strings used by the demystified theme&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$string[&#039;backgroundcolor&#039;] = &#039;Background colour&#039;;&lt;br /&gt;
$string[&#039;backgroundcolordesc&#039;] = &#039;This sets the background colour for the theme.&#039;;&lt;br /&gt;
$string[&#039;configtitle&#039;] = &#039;Demystified theme&#039;;&lt;br /&gt;
$string[&#039;customcss&#039;] = &#039;Custom CSS&#039;;&lt;br /&gt;
$string[&#039;customcssdesc&#039;] = &#039;Any CSS you enter here will be added to every page allowing your to easily customise this theme.&#039;;&lt;br /&gt;
$string[&#039;footnote&#039;] = &#039;Footnote&#039;;&lt;br /&gt;
$string[&#039;footnotedesc&#039;] = &#039;The content from this textarea will be displayed in the footer of every page.&#039;;&lt;br /&gt;
$string[&#039;logo&#039;] = &#039;Logo&#039;;&lt;br /&gt;
$string[&#039;logodesc&#039;] = &#039;Enter the URL to an image to use as the logo for this site. Should be http://www.yoursite.com/path/to/logo.png&#039;;&lt;br /&gt;
$string[&#039;regionwidth&#039;] = &#039;Column width&#039;;&lt;br /&gt;
$string[&#039;regionwidthdesc&#039;] = &#039;This sets the width of the two block regions that form the left and right columns.&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above lines of code I have added an entry for each language string we used within &#039;&#039;settings.php&#039;&#039;. When adding language strings like this make sure you use single quotes and try to keep things alphabetical - it helps greatly when managing strings.&lt;br /&gt;
&lt;br /&gt;
Now when we view the settings page there will not be any errors or strings missing.&lt;br /&gt;
&lt;br /&gt;
===Having a look at what we have created===&lt;br /&gt;
Now that we have created our settings page (settings.php) and added all of the language strings it is time to have a look at things in your browser.&lt;br /&gt;
&lt;br /&gt;
Open your browser and enter the URL to your site. When you arrive at your site login as an administrator.&lt;br /&gt;
&lt;br /&gt;
If you are not redirected to view the new settings change your URL to &amp;lt;nowiki&amp;gt;http://www.yoursite.com/admin/&amp;lt;/nowiki&amp;gt; and your will see a screen to set the new theme settings we have just created. This lets us know that everything has worked correctly.&lt;br /&gt;
&lt;br /&gt;
At any point now you are able to log in as administrator and within the settings block browse to &#039;&#039;&#039;Site administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Demystified theme&#039;&#039;&#039; to change those settings.&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows you what you should see at this point:&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.03.png|715px|thumb|left|The settings page we just created]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using the settings in CSS==&lt;br /&gt;
With the settings page now created and operational it is time to make use of our new settings. The settings that we want to use within our CSS is as follows:&lt;br /&gt;
&lt;br /&gt;
; backgroundcolor : Will be used to set the background colour in CSS.&lt;br /&gt;
; regionwidth : Will be the width of the column for CSS.&lt;br /&gt;
; customcss : Will be some custom CSS to add to our stylesheet.&lt;br /&gt;
&lt;br /&gt;
At this point those names are the names we used for our setting with the slash and everything before it having been removed.&lt;br /&gt;
&lt;br /&gt;
Before we start tearing into some code it is important that we have a look at what we are going to do and how we are going to go about it.&lt;br /&gt;
&lt;br /&gt;
===How it all works within Moodle===&lt;br /&gt;
The first thing to understand is that while Moodle allows you to create a settings page and automates it inclusion and management right into the administration interfaces there is no smart equivalent for using the settings. This is simply because there is no way to predict how people will want to use the settings.&lt;br /&gt;
&lt;br /&gt;
However don&#039;t think of this as a disadvantage, in fact it is quite the contrary. Although we can&#039;t just &#039;&#039;use&#039;&#039; our settings we can take full control over how and where we use them. It means it will take a little more code but in the end that will work to our advantage as we can do anything we want.&lt;br /&gt;
&lt;br /&gt;
Moodle does help us out a little but not in an obvious way. The first thing that Moodle does is look for a config variable &#039;&#039;&#039;csspostprocess&#039;&#039;&#039; that should be the name of a function which we want called to make any changes to the CSS after it has been prepared.&lt;br /&gt;
&lt;br /&gt;
The second thing Moodle does is include a lib.php from the theme&#039;s directory if one exists (also for the themes the current theme extends.) which ensures that as long as we write our code within &#039;&#039;&#039;theme/demystified/lib.php&#039;&#039;&#039; it will be included and ready to be used.&lt;br /&gt;
&lt;br /&gt;
The third and final thing Moodle does that will help us out here is ensure that by the time any of code is ready to execute the settings have been prepared and are ready to be used within a theme config object which is passed into our &#039;&#039;csspostprocess&#039;&#039; function.&lt;br /&gt;
&lt;br /&gt;
===Our plan===&lt;br /&gt;
As you have already probably guessed we will need to create a function to make the changes to the CSS that we want. We will then set the theme config option &#039;&#039;&#039;$THEME-&amp;gt;csspostprocess&#039;&#039;&#039; to the name of our function.&lt;br /&gt;
&lt;br /&gt;
By doing this when Moodle builds the CSS file it will call our function afterwards with the CSS and the theme object that contains our setting.&lt;br /&gt;
&lt;br /&gt;
Now we know that we will use the &#039;&#039;csspostprocess&#039;&#039; function but how are we going to change the CSS, we could get the function to add CSS, or we could get the function to replace something within the CSS. My personal preference is to replace something within the CSS, just like what is happening with images. If you want to use an image within CSS you would write &amp;lt;nowiki&amp;gt;[[pix:theme|imagename]]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For settings I am going to use &amp;lt;nowiki&amp;gt;[[setting:settingname]]&amp;lt;/nowiki&amp;gt;, this way it looks a bit like something you are already familiar with.&lt;br /&gt;
&lt;br /&gt;
What we need to decide upon next is the best way in which to replace our settings tag with the settings that the user has set.&lt;br /&gt;
&lt;br /&gt;
There are two immediate options available to us:&lt;br /&gt;
# Make the &#039;&#039;csspostprocess&#039;&#039; function do all the work.&lt;br /&gt;
# Make the &#039;&#039;csspostprocess&#039;&#039; function call a separate function for each setting.&lt;br /&gt;
Solution 1 might sound like the simplest however it is going to result in a &#039;&#039;&#039;VERY&#039;&#039;&#039; complex function. Remember the user might have left settings blank or entered something that wouldn&#039;t be valid so we would need to make the sure there is some validation and a good default.&lt;br /&gt;
Because of this I think that solution 2 is the better solution.&lt;br /&gt;
&lt;br /&gt;
So we are going to need a &#039;&#039;csspostprocess&#039;&#039; function and then a function for each of the three settings we have that will do the replacements.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// This is our css post process function&lt;br /&gt;
function demystified_process_css($css, $theme) {};&lt;br /&gt;
// This replaces [[setting:backgroundcolor]] with the background colour&lt;br /&gt;
function demystified_set_backgroundcolor($css, $backgroundcolor) {};&lt;br /&gt;
// This replaces [[setting:regionwidth]] with the correct region width&lt;br /&gt;
function demystified_set_regionwidth() {$css, $regionwidth};&lt;br /&gt;
// This replaces [[setting:customcss]] with the custom css&lt;br /&gt;
function demystified_set_customcss() {$css, $customcss};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you should note about the above functions is that they all start with the theme&#039;s name. This is required to ensure that the functions are named uniquely as it is VERY unlikely that someone has already created these functions.&lt;br /&gt;
&lt;br /&gt;
So with our plan set out lets start writing the code.&lt;br /&gt;
&lt;br /&gt;
===Writing the code===&lt;br /&gt;
The very first thing that we need to do is create a lib.php for our theme into which our css processing functions are going to go. So please at this point create &#039;&#039;&#039;theme/demystified/lib.php&#039;&#039;&#039; and open it in your editor ready to go.&lt;br /&gt;
&lt;br /&gt;
The first bit of code we have to write is the function that will be called by Moodle to do the processing &#039;&#039;&#039;demystified_process_css&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Before we start out please remember that the wonderful thing about coding is that there is any number of solutions to a problem. The solutions that you are seeing here in this tutorial are solutions that I have come up with to meet fulfil the needs of the tutorial without being so complex that they are hard to understand. This probably isn&#039;t how I would go about it normally but this is a little easier to understand for those who aren&#039;t overly familiar with PHP and object orientation.&lt;br /&gt;
&lt;br /&gt;
====The function: demystified_process_css====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function demystified_process_css($css, $theme) {&lt;br /&gt;
&lt;br /&gt;
    if (!empty($theme-&amp;gt;settings-&amp;gt;backgroundcolor)) {&lt;br /&gt;
        $backgroundcolor = $theme-&amp;gt;settings-&amp;gt;backgroundcolor;&lt;br /&gt;
    } else {&lt;br /&gt;
        $backgroundcolor = null;&lt;br /&gt;
    }&lt;br /&gt;
    $css = demystified_set_backgroundcolor($css, $backgroundcolor);&lt;br /&gt;
&lt;br /&gt;
    if (!empty($theme-&amp;gt;settings-&amp;gt;regionwidth)) {&lt;br /&gt;
        $regionwidth = $theme-&amp;gt;settings-&amp;gt;regionwidth;&lt;br /&gt;
    } else {&lt;br /&gt;
        $regionwidth = null;&lt;br /&gt;
    }&lt;br /&gt;
    $css = demystified_set_regionwidth($css, $regionwidth);&lt;br /&gt;
&lt;br /&gt;
    if (!empty($theme-&amp;gt;settings-&amp;gt;customcss)) {&lt;br /&gt;
        $customcss = $theme-&amp;gt;settings-&amp;gt;customcss;&lt;br /&gt;
    } else {&lt;br /&gt;
        $customcss = null;&lt;br /&gt;
    }&lt;br /&gt;
    $css = demystified_set_customcss($css, $customcss);&lt;br /&gt;
&lt;br /&gt;
    return $css;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So lets look at the things that make up this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function demystified_process_css($css, $theme) {&lt;br /&gt;
    //.....&lt;br /&gt;
    return $css&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This of course is the function declaration. &lt;br /&gt;
&lt;br /&gt;
The function gets given two variables, the first &#039;&#039;&#039;$css&#039;&#039;&#039; is a pile of CSS as one big string, and the second is the theme object &#039;&#039;&#039;$theme&#039;&#039;&#039; that contains all of the configuration, options, and settings for our theme.&lt;br /&gt;
&lt;br /&gt;
It then returns the &#039;&#039;$css&#039;&#039; variable, essentially returning the modified CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    //...&lt;br /&gt;
    if (!empty($theme-&amp;gt;settings-&amp;gt;backgroundcolor)) {&lt;br /&gt;
        $backgroundcolor = $theme-&amp;gt;settings-&amp;gt;backgroundcolor;&lt;br /&gt;
    } else {&lt;br /&gt;
        $backgroundcolor = null;&lt;br /&gt;
    }&lt;br /&gt;
    $css = demystified_set_backgroundcolor($css, $backgroundcolor);&lt;br /&gt;
    //...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we are processing our first setting &#039;&#039;backgroundcolor&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The first thing that we need to do is check whether it has been set and whether it has a value. If it has then we store that value in &#039;&#039;&#039;$backgroundcolor&#039;&#039;&#039;. It is doesn&#039;t have a value then we set &#039;&#039;$backgroundcolor&#039;&#039; to null. This ensures that &#039;&#039;$backgroundcolor&#039;&#039; is set because if it isn&#039;t then you are going to get a notice (if you have debugging on).&lt;br /&gt;
&lt;br /&gt;
The final line of this block calls the function &#039;&#039;&#039;demystified_set_backgroundcolor&#039;&#039;&#039;. We haven&#039;t written this function yet but we will shortly. When we call it we give it the &#039;&#039;$css&#039;&#039; variable that contains all of the CSS and we give it the background colour variable &#039;&#039;$backgroundcolor&#039;&#039;. Once this function is finished it returns the &#039;&#039;$css&#039;&#039; variable with all of the changes made much like how our css processing function works.&lt;br /&gt;
&lt;br /&gt;
What you should also note about this code is this:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$theme-&amp;gt;settings-&amp;gt;backgroundcolor&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
As mentioned earlier &#039;&#039;$theme&#039;&#039; is an object that contains all of the configuration and settings for our theme. The &#039;&#039;$theme&#039;&#039; object has a $settings property which contains all of the settings for our theme, and finally the settings property contains a variable backgroundcolor that is the value the user entered for that setting. That is how we get a settings value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!empty($theme-&amp;gt;settings-&amp;gt;regionwidth)) {&lt;br /&gt;
    $regionwidth = $theme-&amp;gt;settings-&amp;gt;regionwidth;&lt;br /&gt;
} else {&lt;br /&gt;
    $regionwidth = null;&lt;br /&gt;
}&lt;br /&gt;
$css = demystified_set_regionwidth($css, $regionwidth);&lt;br /&gt;
&lt;br /&gt;
if (!empty($theme-&amp;gt;settings-&amp;gt;customcss)) {&lt;br /&gt;
    $customcss = $theme-&amp;gt;settings-&amp;gt;customcss;&lt;br /&gt;
} else {&lt;br /&gt;
    $customcss = null;&lt;br /&gt;
}&lt;br /&gt;
$css = demystified_set_customcss($css, $customcss);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two routines are nearly identical to the routine above. For both the regionwidth and the customcss we make sure it has a value and then store it in a variable. We then call the relevant function to make the changes for that setting.&lt;br /&gt;
&lt;br /&gt;
Now that we have the general processing function it is time to write the three functions we have used but not written, &#039;&#039;demystified_set_backgroundcolor&#039;&#039;, &#039;&#039;demystified_set_regionwidth&#039;&#039;, &#039;&#039;demystified_set_customcss&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
====The function: demystified_set_backgroundcolor====&lt;br /&gt;
&lt;br /&gt;
First up demystified_set_backgroundcolor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Sets the background colour variable in CSS&lt;br /&gt;
 *&lt;br /&gt;
 * @param string $css&lt;br /&gt;
 * @param mixed $backgroundcolor&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function demystified_set_backgroundcolor($css, $backgroundcolor) {&lt;br /&gt;
    $tag = &#039;[[setting:backgroundcolor]]&#039;;&lt;br /&gt;
    $replacement = $backgroundcolor;&lt;br /&gt;
    if (is_null($replacement)) {&lt;br /&gt;
        $replacement = &#039;#DDDDDD&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    $css = str_replace($tag, $replacement, $css);&lt;br /&gt;
    return $css;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok so what is happening here?&lt;br /&gt;
&lt;br /&gt;
First we need a variable &#039;&#039;&#039;$tag&#039;&#039;&#039; that contains the tag we are going to replace. As mentioned earlier we are going to use tags that look like the image tags you are already familiar with &#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:settingname]]&amp;lt;/nowiki&amp;gt;&#039;&#039;, in this case &#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:backgroundcolor]]&amp;lt;/nowiki&amp;gt;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Next I am going to create a variable called &#039;&#039;&#039;$replacement&#039;&#039;&#039; into which I put &#039;&#039;&#039;$backgroundcolor&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;IF&#039;&#039;&#039; statement that comes next checks &#039;&#039;$replacement&#039;&#039; to make sure it is not null. If it is then we need to set it to a default value. In this case I have used &#039;&#039;#DDD&#039;&#039; as that was the default for the settings.&lt;br /&gt;
&lt;br /&gt;
The line after the IF statement puts it all together. The &#039;&#039;str_replace&#039;&#039; function that we are calling takes three arguments in this order:&lt;br /&gt;
# The text to search for.&lt;br /&gt;
# The text to replace it with.&lt;br /&gt;
# The text to do the replacement in.&lt;br /&gt;
It then returns the text with all of the replacements made. So in this case we are replacing the tag with the background colour and it is returning the changed CSS.&lt;br /&gt;
&lt;br /&gt;
The final thing is to return the &#039;&#039;$css&#039;&#039; variable which now contains the correct background colour.&lt;br /&gt;
&lt;br /&gt;
====The function: demystified_set_regionwidth====&lt;br /&gt;
&lt;br /&gt;
Next we have the demystified_set_regionwidth function.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Sets the region width variable in CSS&lt;br /&gt;
 *&lt;br /&gt;
 * @param string $css&lt;br /&gt;
 * @param mixed $regionwidth&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function demystified_set_regionwidth($css, $regionwidth) {&lt;br /&gt;
    $tag = &#039;[[setting:regionwidth]]&#039;;&lt;br /&gt;
    $doubletag = &#039;[[setting:regionwidthdouble]]&#039;;&lt;br /&gt;
    $replacement = $regionwidth;&lt;br /&gt;
    if (is_null($replacement)) {&lt;br /&gt;
        $replacement = 200;&lt;br /&gt;
    }&lt;br /&gt;
    $css = str_replace($tag, $replacement.&#039;px&#039;, $css);&lt;br /&gt;
    $css = str_replace($doubletag, ($replacement*2).&#039;px&#039;, $css);&lt;br /&gt;
    return $css;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is very similar to the above function however there is one key thing we are doing different. We are doing two replacements.&lt;br /&gt;
&lt;br /&gt;
# The first replacement is for the width that the user selected. In this case I am replacing the tag &#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:regionwidth]]&amp;lt;/nowiki&amp;gt;&#039;&#039; with the width.&lt;br /&gt;
# The second replacement is for the width x 2. This is because the page layout requires that the width be doubled for some of the CSS. Here I will replace &#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:regionwidthdouble]]&amp;lt;/nowiki&amp;gt;&#039;&#039; with the doubled width.&lt;br /&gt;
&lt;br /&gt;
Remember because it is still just a number we need to add &#039;&#039;&#039;px&#039;&#039;&#039; to the end of each before we do the replacement.&lt;br /&gt;
&lt;br /&gt;
So the overall process of this function is:&lt;br /&gt;
# Define the two tags as &#039;&#039;&#039;$tag&#039;&#039;&#039; and &#039;&#039;&#039;$doubletag&#039;&#039;&#039;.&lt;br /&gt;
# Make &#039;&#039;&#039;$replacement&#039;&#039;&#039; the region width &#039;&#039;$regionwidth&#039;&#039;.&lt;br /&gt;
# Set &#039;&#039;$replacement&#039;&#039; to a default value of 200 is it is null.&lt;br /&gt;
# Replace &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:regionwidth]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; with the width.&lt;br /&gt;
# Replace &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:regionwidthdouble]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; with the width x 2.&lt;br /&gt;
# Return the changed CSS.&lt;br /&gt;
&lt;br /&gt;
====The function: demystified_set_customcss====&lt;br /&gt;
&lt;br /&gt;
The final function that we need to write is the demystified_set_customcss function.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Sets the custom css variable in CSS&lt;br /&gt;
 *&lt;br /&gt;
 * @param string $css&lt;br /&gt;
 * @param mixed $customcss&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function demystified_set_customcss($css, $customcss) {&lt;br /&gt;
    $tag = &#039;[[setting:customcss]]&#039;;&lt;br /&gt;
    $replacement = $customcss;&lt;br /&gt;
    if (is_null($replacement)) {&lt;br /&gt;
        $replacement = &#039;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    $css = str_replace($tag, $replacement, $css);&lt;br /&gt;
    return $css;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is just like the first function. I&#039;m going to let you work it out on your own.&lt;br /&gt;
&lt;br /&gt;
And that is it no more PHP... Hallelujah I can hear you yelling. The final thing we need to do is tell our theme about the functions we have written and put the settings tags into the CSS.&lt;br /&gt;
&lt;br /&gt;
===Finishing it all off===&lt;br /&gt;
&lt;br /&gt;
So there are two things we have to do in order to complete this section and have our the settings page implemented and our settings being used.&lt;br /&gt;
&lt;br /&gt;
First we need to tell our theme that we want to use the function &#039;&#039;demystified_process_css&#039;&#039; as the &#039;&#039;csspostprocess&#039;&#039; function. This is done very simply by adding the following line of PHP to the bottom of our theme&#039;s config.php file &#039;&#039;&#039;theme/demystified/config.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;csspostprocess = &#039;demystified_process_css&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done the only thing left is to add the settings tag into the CSS. Remember those settings tags are:&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;nowiki&amp;gt;[[setting:backgroundcolor]]&amp;lt;/nowiki&amp;gt; : We need to add this where ever we want the background colour setting to be used.&lt;br /&gt;
; &amp;lt;nowiki&amp;gt;[[setting:regionwidth]]&amp;lt;/nowiki&amp;gt; : We need to add this where ever we want to set the width of the block regions.&lt;br /&gt;
; &amp;lt;nowiki&amp;gt;[[setting:regionwidthdouble]]&amp;lt;/nowiki&amp;gt; : We need to add this where ever we want to set the doubled width of the block regions.&lt;br /&gt;
; &amp;lt;nowiki&amp;gt;[[setting:customcss]]&amp;lt;/nowiki&amp;gt; : We need to add this to the bottom of the CSS file that we want the custom CSS added to.&lt;br /&gt;
&lt;br /&gt;
So lets make those changes in CSS now, open up your &#039;&#039;core.css&#039;&#039; file and replace the CSS with the CSS below:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/** Background color is a setting **/&lt;br /&gt;
html {background-color:[[setting:backgroundcolor]];}&lt;br /&gt;
body {margin:30px;padding:0;border:1px solid #333;border-width:0 10px 0 10px;background-color:#333;}&lt;br /&gt;
body #page {background-color:#FFF;position:relative;top:-10px;}&lt;br /&gt;
.block .header {background-image:none;background-color:#0C5CAC;border:1px solid #0C5CAC;color:#FFF;}&lt;br /&gt;
.block {border-color:#4BA7FF;background-color:#DDEEFF;}&lt;br /&gt;
.block .content {background-color:#F1F8FF;}&lt;br /&gt;
a:link,&lt;br /&gt;
a:visited {color:#0C5CAC;}&lt;br /&gt;
a:hover {color:#C77500;}&lt;br /&gt;
#page #page-header {background-color:#0C5CAC;margin:0;padding:0;width:100%;color:#fff;}&lt;br /&gt;
#page #page-header a:link, #page #page-header a:visited {color:#FFAC02}&lt;br /&gt;
#page #page-header .navbar, #page #page-header .navbar a:link, #page #page-header .navbar a:visited {color:#0C5CAC;}&lt;br /&gt;
/** Override the region width **/&lt;br /&gt;
#page-content #region-main-box {left:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidthdouble]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-pre {width:[[setting:regionwidth]];left:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-post {width:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidthdouble]];}&lt;br /&gt;
.side-pre-only #page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidth]];}&lt;br /&gt;
.side-pre-only #page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidth]];}&lt;br /&gt;
/** Custom CSS **/&lt;br /&gt;
[[setting:customcss]]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that &amp;lt;nowiki&amp;gt;[[setting:backgroundcolor]]&amp;lt;/nowiki&amp;gt; has been used for the html tags background colour:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
html {background-color:[[setting:backgroundcolor]];}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have also set the width of the block regions by adding &amp;lt;nowiki&amp;gt;[[setting:regionwidth]]&amp;lt;/nowiki&amp;gt; as the width for region-pre and region-post as shown below:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
#page-content #region-main-box {left:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidthdouble]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-pre {width:[[setting:regionwidth]];left:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-post {width:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidthdouble]];}&lt;br /&gt;
.side-pre-only #page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidth]];}&lt;br /&gt;
.side-pre-only #page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidth]];}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You&#039;ll notice here that we have to set several different widths and margins using the regionwidth setting and make use of the special regionwidthdouble setting that we added.&lt;br /&gt;
&lt;br /&gt;
The final thing that we did was add the &amp;lt;nowiki&amp;gt;[[setting:customcss]]&amp;lt;/nowiki&amp;gt; to the bottom of the file to ensure that the custom CSS comes last (and therefore can override all other CSS).&lt;br /&gt;
&lt;br /&gt;
And with that we are finished. The screenshot below shows how this now looks in the browser if I set the background colour setting to &#039;&#039;&#039;&amp;lt;span style=&#039;color:#FFA800;&#039;&amp;gt;#FFA800&amp;lt;/span&amp;gt;&#039;&#039;&#039; and made the column width 240px;&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.04.png|715px|thumb|left|Our settings in action]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using the settings within our layout files==&lt;br /&gt;
Now that we have utilised the first three settings within our theme&#039;s CSS file it is time to implement the other two settings within the layout files so that they are written directly into the page.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be glad to know this is no where near as difficult as utilising settings within a CSS file although it still does require a little bit of PHP.&lt;br /&gt;
&lt;br /&gt;
First up is the logo setting. Into this setting the user is able to enter the URL to an image to use as the logo for the site. In my case I want this to be just a background logo on top of which I want to position the page header.&lt;br /&gt;
&lt;br /&gt;
Before I start there is one thing I need to do however and that is create a default logo background that gets shown if the user hasn&#039;t set a specific logo file. To do this I simply created an image &#039;&#039;&#039;logo.jpg&#039;&#039;&#039; and put it into a pix directory within the demystified theme. You should end up with &#039;&#039;&#039;theme/demystified/pix/logo.jpg&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Next open up the front-page layout file &#039;&#039;theme/demystified/layout/frontpage.php&#039;&#039;. At the top of the file is the PHP that checks what blocks regions the page has and a bit of other stuff. Well right below the existing bit of PHP we want to add the following code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!empty($PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;logo)) {&lt;br /&gt;
    $logourl = $PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;logo;&lt;br /&gt;
} else {&lt;br /&gt;
    $logourl = $OUTPUT-&amp;gt;pix_url(&#039;logo&#039;, &#039;theme&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
What we are doing here is creating a variable called $logourl that will contain the URL to a logo file that was either entered by the user or if they left it blank is that of our default logo file.&lt;br /&gt;
&lt;br /&gt;
There are two things that you should notice about this. First the logo setting can be retrieved through &#039;&#039;&#039;$PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;logo&#039;&#039;&#039; and second we get the default logo url by calling &#039;&#039;&#039;$OUTPUT-&amp;gt;pix_url(&#039;logo&#039;, &#039;theme&#039;)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Now that we have the logo URL we are going to use we need to add an image to the header section of the page as shown below:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page-header&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;img class=&amp;quot;sitelogo&amp;quot; src=&amp;quot;&amp;lt;?php echo $logourl;?&amp;gt;&amp;quot; alt=&amp;quot;Custom logo here&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;
....&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you save that and browse to your sites front page you will notice that the logo file is now being shown. Hooray. However it is probably not styled too nicely so lets quickly fix that. Open up the core.css file and add the following lines of CSS to the bottom of the file.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
#page-header {position:relative;min-height:100px;}&lt;br /&gt;
#page-header .sitelogo {float:left;}&lt;br /&gt;
#page-header .headermain {position:absolute;left:0.5em;top:50px;margin:0;float:none;font-size:40px;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
These three lines position the image correctly and if you now refresh everything should appear perfectly. &lt;br /&gt;
&lt;br /&gt;
With the logo done the last setting we need to deal with is the footnote setting. The idea with this setting was that the administrator could enter some text into the editor and it would be displayed in the footer of the page.&lt;br /&gt;
&lt;br /&gt;
This is probably the easiest setting to implement.&lt;br /&gt;
&lt;br /&gt;
Within the front page layout file that we edited above add the following lines below those we added previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!empty($PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;footnote)) {&lt;br /&gt;
    $footnote = $PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;footnote;&lt;br /&gt;
} else {&lt;br /&gt;
    $footnote = &#039;&amp;lt;!-- There was no custom footnote set --&amp;gt;&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we are just collecting the footnote into a variable &#039;&#039;&#039;$footnote&#039;&#039;&#039; and setting a default footnote comment if the user hasn&#039;t entered one.&lt;br /&gt;
&lt;br /&gt;
We can now echo the $footnote variable within the page footer. This can be done as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;!-- START OF FOOTER --&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;footnote&amp;quot;&amp;gt;&amp;lt;?php echo $footnote; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that done we are finished! Congratulations if you got this far.&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows the demystified theme we have just created that is styled by the settings page.&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.05.png|715px|thumb|left|My finished demystified theme]]&amp;lt;br style=&amp;quot;clear:both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing our creation==&lt;br /&gt;
Congratulations to you! If you&#039;ve made it this far you have done very well. Now it is time to have a look at what we have created and give it a quick test run.&lt;br /&gt;
&lt;br /&gt;
So in this tutorial we have achieved the following:&lt;br /&gt;
&lt;br /&gt;
* We created a theme called demystified that is based on the standard theme.&lt;br /&gt;
* We added a settings page to our new theme.&lt;br /&gt;
* We added the following settings to our settings page:&lt;br /&gt;
** We can set a background colour through the admin interface.&lt;br /&gt;
** We can change the logo of the site.&lt;br /&gt;
** We can change the block region width.&lt;br /&gt;
** We can add a footnote to the page footer&lt;br /&gt;
** We can add some custom CSS to seal the deal.&lt;br /&gt;
* Those settings were then used in the CSS files for our theme.&lt;br /&gt;
* They were also used in the layout files for our theme.&lt;br /&gt;
* And here we are testing it all.&lt;br /&gt;
&lt;br /&gt;
The screenshots below show my testing process and I change each setting and view the outcome. The great thing about this is that with theme designer mode on you see the changes as soon as the form refreshes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.06.png|300px|thumb|left|Default settings]]&lt;br /&gt;
[[Image:Theme.settings.page.07.png|300px|thumb|left|Changed the background colour setting]]&lt;br /&gt;
[[Image:Theme.settings.page.08.png|300px|thumb|left|Changed the logo and region width]]&lt;br /&gt;
[[Image:Theme.settings.page.09.png|300px|thumb|left|Added a footnote]]&lt;br /&gt;
[[Image:Theme.settings.page.10.png|300px|thumb|left|Added some custom CSS]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Common pitfalls and useful notes==&lt;br /&gt;
&lt;br /&gt;
This section is really just a collection of pointers, tips, notes, and other short useful stuff that may be of use to those attempting this tutorial.&lt;br /&gt;
&lt;br /&gt;
# First up and most importantly there are very few limitations to what you achieve in this fashion.&lt;br /&gt;
# If you get stuck or need a hand ask in the forums, there&#039;s always someone round who can help.&lt;br /&gt;
# If you do something really cool let us know, I know everyone in the community loves finding our what others are achieving.&lt;br /&gt;
&lt;br /&gt;
==More information==&lt;br /&gt;
* [[Development:Themes 2.0]]&lt;br /&gt;
* [[Development:Themes 2.0 creating your first theme]]&lt;br /&gt;
* [[Development:Themes 2.0 overriding a renderer]]&lt;br /&gt;
* [[Development:Styling and customising the dock]]&lt;br /&gt;
* http://moodle.org/mod/forum/discuss.php?d=152053&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=72865</id>
		<title>Themes FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Themes_FAQ&amp;diff=72865"/>
		<updated>2010-06-10T20:16:03Z</updated>

		<summary type="html">&lt;p&gt;Tqr: /* How do I install a new theme when using cPanel? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
==How do I install a new theme?==&lt;br /&gt;
&lt;br /&gt;
# Unzip the .zip file to an empty local directory.&lt;br /&gt;
# Upload folder to your web server to the /moodle/theme/[Theme Name]. (Replace [Theme Name] with the name of the theme you have downloaded.) Ensure the new theme folder and its contents are readable by the webserver.  Change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
==How do I install a new theme when using cPanel?==&lt;br /&gt;
&lt;br /&gt;
#Upload your new theme .zip file to your web server via cPanel. &lt;br /&gt;
#Then using cPanel install the new theme to your Moodle theme&#039;s folder.  The new theme will be installed into its own folder at /moodle/theme/[mytheme] (where [mytheme] is the name of your new theme.&lt;br /&gt;
#Ensure the new theme folder and its contents are readable by the webserver. If necessary  change Read and Write permissions (CHMOD) for the files and folder to 755 - Owner read/write/execute, Group read/execute, Everyone read/execute.  Incorrect permissions may prevent display of the newly installed theme.&lt;br /&gt;
# Choose your new theme from within Moodle via &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme selector&#039;&#039;  (or &#039;&#039;Administration &amp;gt; Configuration &amp;gt; Themes&#039;&#039; in versions of Moodle prior to 1.7).&lt;br /&gt;
&lt;br /&gt;
==How do I create a custom theme?==&lt;br /&gt;
&lt;br /&gt;
See [[Creating a custom theme]] and/or [[Make your own theme]].&lt;br /&gt;
&lt;br /&gt;
==Can I assign a specific theme to a course?==&lt;br /&gt;
&lt;br /&gt;
Yes. In the course settings, use the &amp;quot;Force theme&amp;quot; dropdown box.&lt;br /&gt;
&lt;br /&gt;
== Where shall I put my custom CSS code? ==&lt;br /&gt;
&lt;br /&gt;
Instead of modifying the theme&#039;s CSS files you better put your own code in a separate CSS file and make your theme aware of that file by modifying its config.php file (be sure add your own CSS file as the last one in the list so that you will override all prior settings). See this posting for [http://moodle.org/mod/forum/discuss.php?d=128599#p564055 detailed instructions]. &lt;br /&gt;
&lt;br /&gt;
See also the instructions on creating your own theme mentioned above.&lt;br /&gt;
&lt;br /&gt;
==How can I get the New Moodle2 theme for my site?==&lt;br /&gt;
Not til Moodle 2.x comes out and it will be a &amp;quot;sort of&amp;quot;.  The new look (refered to as &amp;quot;Moodle2&amp;quot;) for Moodle.org was made public just before the close of 2008. The Moodle2 look has various things hard coded into its fabric.   The good news is that many pieces of the look are available.&lt;br /&gt;
&lt;br /&gt;
==Will I lose my courses, language files, logo, etc. if I switch my theme?==&lt;br /&gt;
Switching themes only changes the appearance of your site, not the content within it. The logo is a part of the theme and will be lost when you switch.&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to [[Creating_a_custom_theme#Adding_a_Logo|add a logo]] to a theme.&lt;br /&gt;
&lt;br /&gt;
== Are there tools which help me creating and editing themes? ==&lt;br /&gt;
&lt;br /&gt;
=== Clear Cache Button ===&lt;br /&gt;
This useful Firefox add-on let&#039;s you add a button to your tool bar for easily clearing your cache while working on your theme: https://addons.mozilla.org/de/firefox/addon/1801&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;Please note that the following tools are only for development. They only change the way &#039;&#039;you&#039;&#039; see your Moodle site, not the Moodle site itself. Any changes you make using these tools will not be visible to anyone else who uses your site. For this you will have to make those changes permanent by changing your theme&#039;s CSS files for example.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Firebug ===&lt;br /&gt;
The single most useful tool is the [[Development:Firebug|Firebug]] add-on for the [[Firefox]] web browser. Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page... And there are additional add-ons for making Firebug an even more powerful tool.&lt;br /&gt;
&lt;br /&gt;
==== Firebug enhancements ====&lt;br /&gt;
You can enhance Firebug even further. See [[Firebug]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Web Developer Toolbar ===&lt;br /&gt;
Another great tool for any web developer is the [[Web developer extension]], another Firefox add-on. One very useful feature is the option to &#039;&#039;&#039;disable your browser&#039;s cache&#039;&#039;&#039; while working on your theme. That way you are sure you&#039;re always presented with your latest modifications and not with an older, cached version.&lt;br /&gt;
&lt;br /&gt;
Now also available for Google&#039;s Chrome browser: [http://www.sitepoint.com/blogs/2010/03/23/chrome-web-developer-toolbar/ &amp;quot;The Web Developer Toolbar Comes to Chrome&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Stylish ===&lt;br /&gt;
Modifications made with Firebug are lost when refreshing your page. If you want your CSS changes to be a bit more permanent, for example to try them with different pages of your Moodle installation, you can use another Firefox plugin: [https://addons.mozilla.org/en-US/firefox/addon/2108 Stylish]. That way you can change your site&#039;s CSS with a simple mouse click without having to change Moodle code.&lt;br /&gt;
&lt;br /&gt;
See [[Stylish]] for detailed instructions and examples.&lt;br /&gt;
&lt;br /&gt;
== How do I check for cross-browser compatibility? ==&lt;br /&gt;
There are some tools (standalone and online) which can show you how your site looks in different browsers. See this [http://moodle.org/mod/forum/discuss.php?d=127746 forum discussion] for details.&lt;br /&gt;
&lt;br /&gt;
== Concrete examples for modifying Moodle themes ==&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
The following examples were taken from the former &#039;&#039;Theme Scrapbook&#039;&#039;:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;The Moodle &#039;&#039;&#039;Theme Scrapbook&#039;&#039;&#039; is a collection of small how-to descriptions. You theme designers and Moodle users working with themes add your knowledge here to help new Moodle users with tips and tricks for their theme work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Feel free to add to this list! Don&#039;t know how? Read our [[MoodleDocs:Guidelines_for_contributors|Guidelines for contributors]].&amp;quot;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing things ===&lt;br /&gt;
&lt;br /&gt;
==== Colors ====&lt;br /&gt;
* [[Forcing the colour of the chat discussion pane (pop-up mode)]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=142765 Changing background colour of a topic box]&lt;br /&gt;
&lt;br /&gt;
==== Logo and icons ====&lt;br /&gt;
* [[Alternate Icon Set|Using an alternate icon set in Moodle]]&lt;br /&gt;
* [[Favicon|Change the favicon that shows in front of the web address]]&lt;br /&gt;
* [[Footer replacement|Replace the logo in the footer with your web address and/or or own logo]]&lt;br /&gt;
*[[Header logo|Replace the logo in the header]]&lt;br /&gt;
&lt;br /&gt;
==== Layout ====&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=136546 Overriding the $menu / $button variables] using PHP regular expressions in header.html&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=143411 Changing the view of course categories] - work in progress&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=143411 Sub categories and courses layout] - work in progress&lt;br /&gt;
&lt;br /&gt;
=== Adding things ===&lt;br /&gt;
* [[Header logo|Adding a logo to the theme header]]&lt;br /&gt;
&lt;br /&gt;
=== Hiding things ===&lt;br /&gt;
* Hiding an element with CSS is generally achieved using the [http://reference.sitepoint.com/css/display display: none;] property on the element.&lt;br /&gt;
* See [[Print style]] and [[Stylish#Print style for Database records]] for an example how to hide parts of a page not meant for printing.&lt;br /&gt;
&lt;br /&gt;
=== Moving things ===&lt;br /&gt;
* [[Center Forum Posts|Centre smaller forum posts on the page]]&lt;br /&gt;
* [[Footer positioning|Positioning the page footer]]&lt;br /&gt;
* [[Left-align quiz|Left align quiz questions and answers]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=121847 Indentation for nested categories]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=128599 Positioning login and choose language field]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=145179 Match question type - position answers nearer to the questions]&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous ===&lt;br /&gt;
* [[Fixed-width theme|Creating a fixed-width theme]]&lt;br /&gt;
* [[Homepage design|Homepage design of moodle.org]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=146763 Is there a way to fix oversized HTML Editor using CSS?]&lt;br /&gt;
&lt;br /&gt;
==How can I see theme changes when using the Windows Complete Installer package==&lt;br /&gt;
In the [http://download.moodle.org/windows/ Windows Complete Installer package], the eAccelerator in the XAMPP install can cause some issues with changes to your theme&#039;s CSS and HTML files from showing.&lt;br /&gt;
&lt;br /&gt;
Open the php.ini file inside of the server\php folder from your install in notepad and search for &amp;quot;eAccelerator&amp;quot; you should see a line that reads: &lt;br /&gt;
 extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Insert a semi-colon (turns the line into a comment) at the start of this line so it now reads: &lt;br /&gt;
 ;extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
Restart the Moodle server using the &amp;quot;stop moodle&amp;quot; and then the &amp;quot;start moodle&amp;quot; programs in your server folder. You should now find that all of your changes to your CSS are reflected as soon as you save the file and refresh your browser cache (usually you can refresh your cache by pressing F5). This FAQ from a discussion at [http://moodle.org/mod/forum/discuss.php?d=151562#p663950 Deactivating caching with XAMPP installations]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?f=29 Themes forum]&lt;br /&gt;
* [[CSS FAQ]]&lt;br /&gt;
* [http://learn.open.ac.uk/mod/oublog/view.php?user=155976 &amp;quot;Understanding Moodle Themes&amp;quot;] - Blog post by [http://moodle.org/user/view.php?id=78896&amp;amp;course=5 Christopher Douce] (Open University)&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=149534 Testing 2.0. Use for modern vs old browsers] forum discussion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[de:Designs_FAQ]]&lt;/div&gt;</summary>
		<author><name>Tqr</name></author>
	</entry>
</feed>