Different customisations for different modules within a theme [URGENT!]

Different customisations for different modules within a theme [URGENT!]

par Ian Usher,
Nombre de réponses : 1

Hello & Happy 2005! It's been a while since I've posted...

I'm writing this at the Nesta Futurelab Design Challenge and (along with Drew Buddie) I'm working on a Moodle site on my local machine - some of the modules of which (Wiki, Glossary, Forum, etc.) will be used to perform functions which are accessed through a rich 'virtual' environment (probably in Director or something similar). I'd like each of the modules to be very graphical - i.e. the Forum to represent a notice board, the Wiki to be some graffiti on a desk, etc. - so what I need to do is to be able to easily customise each module indivually - different backgrounds, layouts, CSS, etc.

Can anyone give me some pointers on where to start - bear in mind this is a 24 hour a day 'sprint' from 10am this morning until 8am GMT on Monday, so the clock's against me!

Many thanks

Ian.

Moyenne des évaluations: -
En réponse à Ian Usher

Re: Different customisations for different modules within a theme [URGENT!]

par Martin Dougiamas,
Avatar Core developers Avatar Documentation writers Avatar Moodle HQ Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers
Sounds fun!

The best approach is to just edit yourtheme/header.html ... insert some PHP just after the bit where the main style sheet is included.

The PHP code needs to examine the $ME variable which is the full current URL of the script being run. If it contains 'mod/assignment' then you know you are in the assignment module, so you can include the assignment style sheet, and so on.

These subsequent style sheets can override any of the styles with new backgrounds, colours, fonts etc ... You might also want to set some new $THEME variables to make sure of some of the colours that are more hardcoded ...