Themes FAQ - MoodleDocs (2024)

Contents

  • 1 Where can I find more Moodle themes?
  • 2 How do I install a new theme?
    • 2.1 How do I install a new theme when using cPanel?
    • 2.2 Why is the new theme I uploaded not showing up in Themes?
  • 3 How do I control what themes show up where?
    • 3.1 How can I restrict the available themes to users and in courses?
    • 3.2 How can I test theme issues on my site without changing the site default theme?
    • 3.3 What is the hierarchy of contexts for themes to override each other?
      • 3.3.1 Hierarchy of themes
      • 3.3.2 Note on Session Themes
  • 4 How do I create a custom theme?
  • 5 Can I assign a specific theme to a course?
  • 6 Is it possible to customise language strings per theme?
  • 7 How can I get the links in my custom menu to open in new windows?
  • 8 Where shall I put my custom CSS code?
  • 9 Will I lose my courses, language files, logo, etc. if I switch my theme?
  • 10 How can I add custom fonts to a theme?
  • 11 Are there tools which help me creating and editing themes?
    • 11.1 Clear Cache Button
    • 11.2 Firebug
      • 11.2.1 Firebug enhancements
    • 11.3 Web Developer Toolbar
    • 11.4 Stylish
      • 11.4.1 Stylish-Custom
  • 12 How do I check for cross-browser compatibility?
  • 13 Concrete examples for modifying Moodle themes
    • 13.1 Changing things
      • 13.1.1 Colors
      • 13.1.2 Logo and icons
      • 13.1.3 Layout
    • 13.2 Adding things
    • 13.3 Hiding things
    • 13.4 Moving things
    • 13.5 Miscellaneous
  • 14 How can I see theme changes when using the Windows Complete Installer package
  • 15 How can I have a custom menu for different roles, eg student or teacher?
  • 16 See also

Where can I find more Moodle themes?

As well as standard themes, which you will find in your Moodle installation, there are many FREE themes available for download from Moodle plugins directory - Category:Themes. Don't forget to choose the correct version of a theme for the version of Moodle you are currently using.

How do I install a new theme?

  1. Unzip the .zip file to an empty local directory.
  2. 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.
  3. Choose your new theme from within Moodle via Site Administration > Appearance > Themes.

How do I install a new theme when using cPanel?

  1. Upload your new theme .zip file to your web server via cPanel.
  2. Then using cPanel install the new theme to your Moodle theme'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.
  3. 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.
  4. Choose your new theme from within Moodle via Site Administration > Appearance > Themes.

Why is the new theme I uploaded not showing up in Themes?

You probably forgot to do something correctly. Here are steps to create a "new" theme from an existing theme called "standard". Bold show places you must change for the theme to appear.

  1. Copy folder theme/standard and call it theme/new
  2. In theme/new/lang/en folder,
    1. Renamed theme_standard.php to theme_new.php
  3. Opened theme/new/lang/en/theme_new.php, recommend you change 2 lines to read something like:
    1. $string['pluginname'] = 'New theme - Martin D';
    2. $string['choosereadme'] = 'New theme came from the Standard theme and is being changed by Martin D in 2011';
    3. Saved the file
  4. In theme/new/config.php
    1. Change $THEME->NAME = 'new';
  5. Went to Site Administration > Appearance > Advanced theme settings and updated Theme designer mode (Checked)
  6. Site Administration > Appearance > Themes
    1. Clear theme caches
    2. Select theme
Tip: 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 FAQ How do I install a new theme when using cPanel? will, in most cases, cure the problem.

How do I control what themes show up where?

You can control which themes show up in which contexts by a series of settings in Site Administration > Appearance > Advanced theme settings.

How can I restrict the available themes to users and in courses?

In Site Administration > Appearance > Advanced theme settings, add the themes you want them to use in the Theme list. These will then restrict the theme choice lists in pull down menus the contexts (Course, Category, User) where you allow them.

How can I test theme issues on my site without changing the site default theme?

You can test out themes for yourself as admin by enabling Session level themes and log in using that method. Since the Session level is per browser session, this will not affect the site default or any other theme settings.

If you are need to log in and out repeatedly while testing a theme with a specific user, it may be more convenient to enable User level themes and then set the theme in the test user's profile as its Preferred theme.

What is the hierarchy of contexts for themes to override each other?

There are five contexts in which themes appear and can be set: courses, category, session, user, and site (or Default, i.e. the site wide default theme). That is the level of priority of appearance they have as well.

  • You enable/disable these in Advanced theme settings.
  • It is possible to change this hierarchy in the config.php file - see change default hierarchy for how.

Hierarchy of themes

  • Course overrides Category (and below)
  • Category overrides Session (and below)
  • Session overrides User (and below)
  • User overrides Cohort (and below)
  • Cohort overrides Default (site)
  • Default (site)


Note: this default hierarchy can be changed in the config.php file.

Note on Session Themes

See here for how to use Session level themes.

  • It is important to note that Session level themes (those set with the URL parameter theme=theme_name), override the Site level theme ONLY for the user's current logged in session. When the user logs out, they will then see the Default site theme, not the Session theme.
  • You only have to set the theme once via the URL parameter and it will persist until the user logs out.

How do I create a custom theme?

If you aren't familiar with CSS and theming, first try customising the 'More' theme within Moodle. See Standard themes

Alternatively, see the developer documentation Theme development.

Can I assign a specific theme to a course?

Yes. In the course settings, use the "Force theme" dropdown box.

Is it possible to customise language strings per theme?

Not by default, as when strings are customised, they are customised for the whole site. However, it is possible to make a new language pack based on your main language and apply that pack to the course which has that theme. See this forum post for more information: https://moodle.org/mod/forum/discuss.php?d=220671

How can I get the links in my custom menu to open in new windows?

It is possible to create your own fly out menu via the custom menu block in Site Administration > Appearance > Advanced theme settings. Copy the examples given below the box. If you want the links to open in a new window, use the following code:

Moodle|http://www.moodle.org" target="_blank

See also https://tracker.moodle.org/browse/MDL-35420

Where shall I put my custom CSS code?

Note that the contributed themes Afterburner, Arialist, Formal White, Fusion, Nonzero, Overlay, Sky High and Splash all offer the possibility to add custom CSS in their page settings via Site Administration > Appearance > Themes. Click on the edit settings icon for the desired theme.

Failing this, instead of modifying the theme'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 detailed instructions.

See also the instructions on creating your own theme mentioned above.

Will I lose my courses, language files, logo, etc. if I switch my theme?

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.

Follow these instructions to add a logo to a theme.

If you upgrade your Moodle site and tweaked an existing standard theme, you will lose your changes. Thus it is a good idea to create a custom theme which will not be changed when you upgrade.

How can I add custom fonts to a theme?

See How to add custom fonts in a theme

Are there tools which help me creating and editing themes?

Clear Cache Button

This useful Firefox add-on let'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

Please note that the following tools are only for development. They only change the way you 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's CSS files for example.

Firebug

The single most useful tool is the 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.

Firebug enhancements

You can enhance Firebug even further. See Firebug for more information.

Web Developer Toolbar

Another great tool for any web developer is the Web developer extension, another Firefox add-on. One very useful feature is the option to disable your browser's cache while working on your theme. That way you are sure you're always presented with your latest modifications and not with an older, cached version.

Now also available for Google's Chrome browser: "The Web Developer Toolbar Comes to Chrome"

Stylish

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: Stylish. That way you can change your site's CSS with a simple mouse click without having to change Moodle code.

See Stylish for detailed instructions and examples.

Stylish-Custom

This is an custom additions to the Stylish extension which brings back features from 0.5.9 and adds new features.

How do I check for cross-browser compatibility?

There are some tools (standalone and online) which can show you how your site looks in different browsers. See this forum discussion for details.

Concrete examples for modifying Moodle themes

The following examples were taken from the former Theme Scrapbook:
"The Moodle Theme Scrapbook 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.
Feel free to add to this list! Don't know how? Read our Guidelines for contributors."

Changing things

Colors

  • dev:Forcing the colour of the chat discussion pane (pop-up mode)
  • Changing background colour of a topic box
  • How to change the colour of the popup event's header and background

Logo and icons

  • Change the favicon that shows in front of the web address

Layout

  • Overriding the $menu / $button variables using PHP regular expressions in header.html
  • Changing the view of course categories - work in progress
  • Sub categories and courses layout - work in progress
  • Tracker 'components' list too small

Adding things

  • How to add a different img-bullet to each category?

Hiding things

  • Hiding an element with CSS is generally achieved using the display: none; property on the element.
  • See dev:Print style and dev:Stylish#Print style for Database records for an example how to hide parts of a page not meant for printing.

Moving things

  • Positioning login and choose language field
  • Match question type - position answers nearer to the questions

Miscellaneous

  • Is there a way to fix oversized HTML Editor using CSS?

How can I see theme changes when using the Windows Complete Installer package

In the Windows Complete Installer package, the eAccelerator in the XAMPP install can cause some issues with changes to your theme's CSS and HTML files from showing.

Open the php.ini file inside of the server\php folder from your install in notepad and search for "eAccelerator" you should see a line that reads:

extension=eaccelerator.dll

Insert a semi-colon (turns the line into a comment) at the start of this line so it now reads:

;extension=eaccelerator.dll

Restart the Moodle server using the "stop moodle" and then the "start moodle" 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 Deactivating caching with XAMPP installations

How can I have a custom menu for different roles, eg student or teacher?

While it is not possible to show a different menu to different roles (because they tend to be assigned course-wide not site-wide), it is possible to have a different menu for different users. See this forum post on custom menus

See also

  • Using Moodle Themes forum
  • dev:CSS FAQ
  • Allow theme change by URL
Themes FAQ - MoodleDocs (2024)
Top Articles
Laminate vs Granite Countertops: Which Is Better for A Home Kitchen? - Guilin Cabinets
Monzo Perks | An Account with Added Benefits | £7 a month
How To Fix Epson Printer Error Code 0x9e
Asist Liberty
Terrorist Usually Avoid Tourist Locations
El Paso Pet Craigslist
Paris 2024: Kellie Harrington has 'no more mountains' as double Olympic champion retires
Explore Tarot: Your Ultimate Tarot Cheat Sheet for Beginners
Kobold Beast Tribe Guide and Rewards
The Potter Enterprise from Coudersport, Pennsylvania
Aiken County government, school officials promote penny tax in North Augusta
Waive Upgrade Fee
Carter Joseph Hopf
2013 Chevy Cruze Coolant Hose Diagram
Urban Dictionary Fov
1Win - инновационное онлайн-казино и букмекерская контора
Craigslist Pets Sac
2021 Lexus IS for sale - Richardson, TX - craigslist
Magic Mike's Last Dance Showtimes Near Marcus Cedar Creek Cinema
Dr Adj Redist Cadv Prin Amex Charge
Soccer Zone Discount Code
Vipleaguenba
MyCase Pricing | Start Your 10-Day Free Trial Today
2487872771
Olivia Maeday
What Individuals Need to Know When Raising Money for a Charitable Cause
Soul Eater Resonance Wavelength Tier List
January 8 Jesus Calling
Preggophili
O'reilly's In Monroe Georgia
Lcsc Skyward
Paradise Point Animal Hospital With Veterinarians On-The-Go
Srjc.book Store
Revelry Room Seattle
Amazing Lash Bay Colony
Isablove
FREE Houses! All You Have to Do Is Move Them. - CIRCA Old Houses
Ket2 Schedule
Bismarck Mandan Mugshots
Gets Less Antsy Crossword Clue
8 Ball Pool Unblocked Cool Math Games
Gt500 Forums
Immobiliare di Felice| Appartamento | Appartamento in vendita Porto San
Directions To Cvs Pharmacy
8776725837
Poe Self Chill
Strange World Showtimes Near Century Stadium 25 And Xd
Csgold Uva
3367164101
Kushfly Promo Code
Bbwcumdreams
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 6557

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.