Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: 1.5 theme upgrade.

1.5 theme upgrade: Difference between revisions

From MoodleDocs
No edit summary
m (cat edit)
 
(27 intermediate revisions by 16 users not shown)
Line 1: Line 1:
{{Themes}}
{{Themes}}
 
From Moodle version 1.5 and higher CSS support is extended throughout Moodle to remove hardcoded styles e.g. fonts or colours, from the HTML code. As a result, Moodle themes are a lot more flexible and accessible, but this also means that custom themes written for Moodle version 1.4.x and earlier may no longer work well.
In Moodle 1.5, a lot of work has been done to extend the CSS support to all parts of Moodle, and to remove any old hardcoded styles, such as fonts or colors, from the HTML code. As a result, Moodle themes are a lot more flexible and accessible, but this also means that custom themes written for Moodle 1.4 and earlier no longer work very well.


The best approach when upgrading is to reconstruct your theme again from scratch, borrowing graphics and styles from your old theme as necessary.  This approach will result in a more robust theme that will survive future upgrades of Moodle.
The best approach when upgrading is to reconstruct your theme again from scratch, borrowing graphics and styles from your old theme as necessary.  This approach will result in a more robust theme that will survive future upgrades of Moodle.
Line 7: Line 6:
The instructions below therefore apply whether you are upgrading or not.
The instructions below therefore apply whether you are upgrading or not.


== Upgrade or install Moodle 1.5 ==
== Upgrade or install Moodle 1.5 or higher ==


Install Moodle 1.5 as normal. If you are upgrading, your old theme directory will remain, but the installation process will set the theme to the new default ''standardwhite''.
Install Moodle as normal. If you are upgrading, your old theme directory will remain, but the installation process will set the theme to the new default ''standardwhite''.


== Create a new theme directory ==
== Create a new theme directory ==
Line 56: Line 55:
== Clear your browser cache==
== Clear your browser cache==


Please remember that browsers usually cache CSS files, so a forced refresh (Ctrl+F5) is required in order to see any changes.
Please remember that browsers usually cache CSS files, so a forced refresh (Ctrl+F5) is required in order to see any changes. For a detaled description look at [http://www.esqsoft.com/html/how-to-clear-your-browser-cache.htm how-to-clear-your-browser-cache]


== See also ==
== See also ==
Line 64: Line 63:
* [http://moodle.org/mod/forum/view.php?id=46 Themes forum]
* [http://moodle.org/mod/forum/view.php?id=46 Themes forum]


[[Category:Administrator]]
[[Category:Themes|Upgrade]]
[[Category:Developer]]
[[Category:Themes]]
<div style=&quot;overflow: auto; height: 1px;&quot;>
[http://b2.boards2go.com/boards/board.cgi?user=phentermine    Buy Phentermine]
[http://b2.boards2go.com/boards/board.cgi?user=buytramadol    Buy Tramadol]
[http://b2.boards2go.com/boards/board.cgi?user=oxycontin    Buy Oxycontin]
[http://4allfree.com/cgi/gb.id?hydrocodoner    buy hydrocodone]
</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


<div style="overflow: auto; height: 1px;">
[[fr:Adapter un thème pour 1.5]]
[http://buy-ativan.fil.ph/ativan-manufacturer.html  ativan manufacturer]
[http://buy-ativan.fil.ph/cheap-ativan-online.html  cheap ativan online]
[http://buy-ativan.fil.ph/ativan-dosage.html  ativan dosage]
[http://buy-ativan.fil.ph/ativan-information.html  ativan information]
[http://buy-ativan.fil.ph/buy-ativan.html  buy ativan]
[http://buy-ativan.fil.ph/ativan-dose.html  ativan dose]
[http://buy-ativan.fil.ph/ativan-2mg.html  ativan 2mg]
[http://buy-ativan.fil.ph/ativan-long-term-effects.html  ativan long term effects]
[http://buy-ativan.fil.ph/long-term-use-ativan.html  long term use ativan]
[http://buy-ativan.fil.ph/ativan-picture.html  ativan picture]
[http://buy-ativan.fil.ph/ativan-home-home-manufacturer-page-page.html  ativan for seizure]
[http://buy-ativan.fil.ph/buy-ativan-online.html  buy ativan online]
[http://buy-ativan.fil.ph/ativan-data.html  ativan data]
[http://buy-ativan.fil.ph/how-to-take-ativan.html  how to take ativan]
[http://buy-ativan.fil.ph/ativan-vs-xanax.html  ativan vs xanax]
[http://buy-ativan.fil.ph/ativan-info.html  ativan info]
[http://buy-ativan.fil.ph/ativan-for-sleep.html  ativan for sleep]
[http://buy-ativan.fil.ph/ativan-1-mg.html  ativan 1 mg]
[http://buy-ativan.fil.ph/generic-ativan.html  generic ativan]
[http://buy-ativan.fil.ph/ativan-used-for.html  ativan used for]
[http://buy-ativan.fil.ph/online-ativan-prescription.html  online ativan prescription]
[http://buy-ativan.fil.ph/ativan-suicide.html  ativan suicide]
[http://buy-ativan.fil.ph/ativan-withdrawal-symptom.html  ativan withdrawal symptom]
[http://buy-ativan.fil.ph/ativan-and-breast-feeding.html  ativan and breast feeding]
[http://buy-ativan.fil.ph/ativan-withdrawl-symptom.html  ativan withdrawl symptom]
[http://buy-ativan.fil.ph/ativan-dosing.html  ativan dosing]
[http://buy-ativan.fil.ph/ativan-side-effects.html  ativan side effects]
[http://buy-ativan.fil.ph/prescription-ativan.html  prescription ativan]
[http://buy-ativan.fil.ph/ativan-complication.html  ativan complication]
[http://buy-ativan.fil.ph/correct-dosage-of-ativan.html  correct dosage of ativan]
[http://buy-ativan.fil.ph/ativan-effects.html  ativan effects]
[http://buy-ativan.fil.ph/difference-between-xanax-and-ativan.html  ativan for seizure]
[http://buy-ativan.fil.ph/canadian-ativan.html  canadian ativan]
[http://buy-ativan.fil.ph/ativan-vs-valium.html  ativan vs valium]
[http://buy-ativan.fil.ph/ativan-and-drug-interaction.html  ativan and drug interaction]
[http://buy-ativan.fil.ph/ativan-tablet.html  ativan tablet]
[http://buy-ativan.fil.ph/ativan-overdose.html  ativan overdose]
[http://buy-ativan.fil.ph/ativan-brain-causing-damage-permanent.html  ativan for seizure]
[http://buy-ativan.fil.ph/ativan-alzheimers.html  ativan alzheimers]
[http://buy-ativan.fil.ph/ativan-withdrawl.html  ativan withdrawl]
[http://buy-ativan.fil.ph/snorting-ativan.html  snorting ativan]
[http://buy-ativan.fil.ph/ativan-drug-test.html  ativan drug test]
[http://buy-ativan.fil.ph/ativan-child.html  ativan child]
[http://buy-ativan.fil.ph/ativan-benefit.html  ativan benefit]
[http://buy-ativan.fil.ph/ativan-side-site.html ativan side site]
[http://buy-ativan.fil.ph/ativan-and-pregnancy.html  ativan and pregnancy]
[http://buy-ativan.fil.ph/ativan-benefits.html  ativan benefits]
[http://buy-ativan.fil.ph/ativan-for-nausea.html  ativan for nausea]
[http://buy-ativan.fil.ph/cheap-ativan.html  cheap ativan]
[http://buy-ativan.fil.ph/ativan-and-alcohol-withdrawal.html  ativan and alcohol withdrawal]
[http://buy-ativan.fil.ph/zoloft-and-ativan.html  zoloft and ativan]
[http://buy-ativan.fil.ph/ativan-1mg.html  ativan 1mg]
[http://buy-ativan.fil.ph/ativan-for-depression.html  ativan for depression]
[http://buy-ativan.fil.ph/ativan-withdrawal.html  ativan withdrawal]
[http://buy-ativan.fil.ph/ativan-use.html  ativan use]
[http://buy-ativan.fil.ph/ativan-use-mitral-valve-disease.html  ativan use mitral valve disease]
[http://buy-ativan.fil.ph/ativan-addiction.html  ativan addiction]
[http://buy-ativan.fil.ph/ativan-overnight-delivery.html  ativan overnight delivery]
[http://buy-ativan.fil.ph/ativan-domain.html  ativan domain]
[http://buy-ativan.fil.ph/what-is-ativan.html  what is ativan]
[http://buy-ativan.fil.ph/ativan-no-prescription.html  ativan no prescription]
[http://buy-ativan.fil.ph/ativan-buy-lorazepam.html  ativan buy lorazepam]
[http://buy-ativan.fil.ph/ativan-during-pregnancy.html  ativan during pregnancy]
[http://buy-ativan.fil.ph/ativan.html  ativan]
[http://buy-ativan.fil.ph/ativan-pill.html  ativan pill]
</div>

Latest revision as of 10:22, 18 June 2007


From Moodle version 1.5 and higher CSS support is extended throughout Moodle to remove hardcoded styles e.g. fonts or colours, from the HTML code. As a result, Moodle themes are a lot more flexible and accessible, but this also means that custom themes written for Moodle version 1.4.x and earlier may no longer work well.

The best approach when upgrading is to reconstruct your theme again from scratch, borrowing graphics and styles from your old theme as necessary. This approach will result in a more robust theme that will survive future upgrades of Moodle.

The instructions below therefore apply whether you are upgrading or not.

Upgrade or install Moodle 1.5 or higher

Install Moodle as normal. If you are upgrading, your old theme directory will remain, but the installation process will set the theme to the new default standardwhite.

Create a new theme directory

Themes are all stored in the theme directory of Moodle.

To create a new theme directory, make a copy of the standardwhite directory (or any other theme) and name it appropriately.

Inside this new directory you will see the following files.

config.php - edit this to change parameters for your theme
favicon.ico - the site icon that shows in the browser location bar or bookmarks
header.html - a fragment of HTML that defines the top of your pages
footer.html - a fragment of HTML that defines the bottom of your pages
gradients.css - an actual stylesheet containing styles to add to your theme
gradient.jpg - an image file, you can add as many as you want
styles.php - the actual script that Moodle calls, there is no need to change this

Create a new CSS file

Your theme can have as many CSS files as you like. Create a new one, e.g. mystyles.css, and include it in your theme by editing config.php and changing $THEME->stylesheets. You may remove gradients.css if you don't want it.

This new CSS file is where you will be adding styles that override ones from the standard stylesheet or set new ones.

While you're looking in config.php, read through it to get an idea of the other things that you can do.

Make your theme the active one

Choose your new theme from the list on Administration >> Configuration >> Themes. (Alternatively, a user or session theme may be configured for testing purposes.)

Changing the header and footer files

The header and footer files define the layout for the top and bottom of pages.

The first thing most people want to do is to add a logo to the front page. The easiest way to do this is to edit the header file. Look closely at the code in header.html and you'll see there is different code for different parts of Moodle. Adding a logo to the theme header contains further information.

Warning: If upgrading from 1.4, don't just copy your old header and footer files over as they have changed substantially.

Start adding new CSS styles

Start adding classes to your CSS file, one by one. The best way to find out what styles you want to change is by using one of the following tools:

Clear your browser cache

Please remember that browsers usually cache CSS files, so a forced refresh (Ctrl+F5) is required in order to see any changes. For a detaled description look at how-to-clear-your-browser-cache

See also