Customising Moodle

Customising Moodle

by David Scotson -
Number of replies: 14

A few people have been asking recently about customising Moodle. In particular people are asking for 'extreme customisation' or for Moodle theme's that don't look like Moodle. Now, I don't think anyone has actually said it can't be done, but enough people have said they haven't seen such a beast to make it seem like it can't.

Ignoring for a moment the strangeness of aiming to change a functional piece of software beyond recognition and the user-interface and usability issues that raises, I think that there is a lot that can be done within the current Moodle Theme infrastructure, but potential themers are perhaps lacking two things:

  • pointers on some semi-advanced HTML/CSS styling techniques
  • inspiration

I've been digging into the possibilities for themeing Moodle and thought I'd share what I've found in the hope of providing something in the way of the two needs above. Hopefully others wil be encouraged to share info on their own tips and modifications from the point of view of sharing knowledge and experience rather than simply finished products for others to use.

So here is my first "theme" (attached), called bleach, which was heavily inspired by Doug Bowman's Introducing Bleached post, which acts as a prelude to his new blog redesign.

It is, as you can see from the screenshot, not really a theme at all, more a mind clearing excersise. It is simply almost everything but the text turned white, which seems as good a place as any to start as any when trying to design Moodle Themes that are examples of "thinking outside the box" clown

If you do try out this theme, note how surprisingly usable it is. Just the bold headings, the repetition, visual alignment and the whitespace between blocks is enough to give subtle clues about what belongs together and what is separate.

Average of ratings: -
In reply to David Scotson

Re: Customising Moodle

by David Scotson -

My second "theme" called skeleton (again attached), takes the opposite tack and highlights the tables that make up the basis of any Moodle theme. Understanding exactly how these tables are made up is vital as they, as the theme name suggests, are the foundation on which you have to build.

If you install the theme you will notice that it looks slightly different from my screenshot. This is because I have added some CSS id's to first add, and then reveal some of the structure underlying a Moodle theme.

To emulate this you will need to add the id's "leftcolumn" "middlecolumn" and "rightcolumn" to the td cell that contains each respective column in the following files:

  • index.php
  • courses/formats/social/format.php
  • courses/formats/weeks/format.php
  • courses/formats/topics/format.php

Once you know where the tables are you have a fairly limited range of options:

  • changing the size and color of the borders on tables and cells
  • changing the padding and margins on tables and cells
  • changing the color of the backgrounds of tables and cells
  • adding images as backgrounds to tables and cells

But by combining these you should be able to create a near unlimited number of interesting looks.

Note that users of the Firefox browser who have installed the Web Developer Extension will be able to apply this table-outlining effect at the touch of a button, and to any website they visit (as well as be able do a variety of other cool and useful web related things).

In reply to David Scotson

Re: Customising Moodle

by N Hansen -
Just installed that web developer extension, and it is great! I wish I had had that when I was trying to get my theme to work. Just trying it out briefly I would say this extension is a MUST-HAVE in customizing a Moodle.
In reply to N Hansen

Re: Customising Moodle

by Jeffery Watkins -
It is amazing the stuff one takes for granted.  I have been using this for a while I guess, and I never thought to post something about it... it just seemed commonplace.

I am trying to go through all of the things I do when creating a theme and tools I use which I think are common knowledge but might not be....

Here is something cool and free, which might be saying the same thing twice!tongueout

http://www.colorschemer.com/online.html

For people who cannot tell what matches colorwise.

I will try to think of more.

Jeff
In reply to David Scotson

Re: Customising Moodle

by Jeffery Watkins -
Here is a screenshot of those tools.  Screenshot


Jeff
In reply to Jeffery Watkins

Re: Customising Moodle

by David Scotson -

I love your Hobbes favicon. Did you make that yourself?

In reply to David Scotson

Re: Customising Moodle

by David Scotson -

My next theme is called colorbox and it simply colors an entire block with a single base color.

As you can see from the screenshot I've chosen to work in shades of gray, simply because it is less to think about at the moment. To translate it into a standard monochrome color-scheme, like you see on Moodle.org, you can simply transpose the white-gray-black color range into pale yellow-orange-brown or whatever colors you wish to use.

The tricky part of this style is the following lines (found at the bottom of style.css):

.sideblock thead,
.sideblock tbody,
.sideblock tr,
.sideblock th,
.sideblock td,
.sideblockmain,
.sideblockmain table,
.sideblocklinks {
    background-color: transparent;
}

.sideblock {
    background: #eee;
 }

This ensures that the color of the base isn't overlapped by the background color of tables and table cells layered on top of it. In this case, it is actually unnecessary, except for the added clarity it gives, since you could just set all the areas to the same shade. However if you were to apply a gradient or patterned background image then transparency would be essential to allow it to show through properly.

The theme also demonstrates a different approach to titles, as rather than being boxed off from the section it titles, the title text is indicated merely by its size and position relative to rest of the block. If you make titles large enough (and you may even consider shortening the titles in the language pack to allow for bigger text e.g. administration -> admin), then fairly low contrast colors will suffice and using`text-transform' to make them all lowercase can give a fairly modern look:

.sideblockheading {
    font-size: 20px;
    color: #aaa;
    background-color: transparent;
    text-transform: lowercase;
}
In reply to David Scotson

Re: Customising Moodle - Fuzzybox theme

by David Scotson -

My fuzzybox theme (which was named for now defunct historical reasons) shows a slight variation on colorbox. As well as the merely cosmetic change of using a darker background, it also shows letter spacing and centered text, which while it sounds simple actually needs some non-obvious CSS trickery in this case.

Screenshot

The interesting CSS is as follows:

.sideblockheading div {
    width: 100%;
    text-align: center;
    letter-spacing: .2em;
    font-size: 12px;
    text-transform: uppercase;
    padding-top: 8px;
    padding-bottom: 3px;
}

You have to target the div and set it's width to 100% or else the text-align will have no effect as these two shots demonstrate. Both have the text centered, and the div outlined in red.

before

and

after

Another thing to notice is the padding that has been added to the top and bottom of the div with the title in it. This is a nice example of making something stand out, not by making it bigger or brighter but by clearing some space around it.

In reply to David Scotson

Re: Customising Moodle - Fuzzybox theme

by Chardelle Busch -
Picture of Core developers

Hi Guys,

Thanks for sharing your themes and ideas, especially thanks for letting us know how to center the text in the sideblocks David.

I was wondering how you get the cool gel and colored buttons in Moodle? They look so much better than the flat white.

Thanks,

Chardelle

In reply to Chardelle Busch

Re: Customising Moodle - Fuzzybox theme

by Jeffery Watkins -
Chardelle,

I think that is b/c of his using a Mac. but, you can change the attributes of the scrollbar in any theme using these CSS tags....

scrollbar-3dlight-color:#ffd700;
scrollbar-arrow-color:#ff0;
scrollbar-base-color:#ff6347;
scrollbar-darkshadow-color:#ffa500;
scrollbar-face-color:#008080;
scrollbar-highlight-color:#ff69b4;
scrollbar-shadow-color:#f0f

Look at this for a detailed explanation: http://www.websitetips.com/info/css/scrollbars.shtml#browser

Jeff
In reply to Chardelle Busch

Re: Customising Moodle - Fuzzybox theme

by David Scotson -

I'm afraid Jeffery's right, you need a Mac to see those 'gelcap' buttons.

You can acheive similar effects on buttons just using some CSS (that site also has some tasteful javascript to make the text on your buttons flash different colors).

The current Moodle HTML won't allow this as there is no way to target a single button, and so every form control on the page changes color together, but this will change in the future.

In reply to David Scotson

Re: Customising Moodle - Fuzzybox theme

by Jeffery Watkins -
David,

Did you alter something other than the theme for the sideblockheading div tag.  It does not seem to work for me for some reason.

Jeff
In reply to Jeffery Watkins

Re: Customising Moodle - Fuzzybox theme

by David Scotson -
I'm building these on an alpha release of 1.4, I guess something may have changed before release. I'll look into it, as you shouldn't have to alter the HTML to get these to work.

What exactly does/doesn't it do?

edit: I quickly switched the themes on one of our working Moodles that's running 1.4 and, at a glance, it seems okay.
In reply to David Scotson

Re: Customising Moodle - Fuzzybox theme

by I Love Moodle -

Good job !

Thank you for your sense of sharing your nicely designed themes.

I wish you success David smile