Stripdown: A New Theme for Moodle

July 13, 2009 • 5 Comments

Last month, I did a two-hour theme workshop at the Oklahoma MoodleMoot. While in the Cincinnati airport waiting for the final leg of my journey, I created a new theme – an antitheme really – for workshop attendees to use as a starting point for their projects. I decided then that this would be a good thing to share with the community.

Introducing Stripdown

Stripdown is nothing more than a stripped-down theme that loads the Moodle Standard stylesheets first. It actually contains no style of its own. That’s for you to work out. Before adding these styles, it looks just like the Standard theme. That’s because your browser is calling Standard before it calls Stripdown, and since Stripdown is essentially empty, all that’s left to display is Standard.

The reason one builds a theme on top of Standard is because Standard gets updated with every new Moodle version. When you update your Moodle installation, you update Standard. If your theme is built on Standard, your theme has less chance of breaking from version to version.

All you have to do to make Stripdown “non-Standard” is add your CSS to the styles.css file inside the theme folder.

Technical parts

Some may like to know just what I’ve done, so here’s a rundown on how Stripdown was created.

  1. Duplicate the Standard theme.
  2. Edit line 9 of config.php to call only one stylesheet – styles.css
    $THEME->sheets = array('styles');
  3. Delete all stylesheets except for styles_layout.css, styles_ie6.css, and styles_ie7.css. Open these three that are left and delete everything in them. You don’t need them since they’re already being loaded by Standard.
  4. Rename your newly empty styles_layout.css to styles.css.
  5. Open header.html and delete the horizontal row from line 42 (not necessary, I just don’t like it).
  6. Change the pathnames in meta.php to reflect the name of your new theme folder (in my case it is stripdown). You’re not using meta.php in your theme yet, but this will prevent hair pulling down the road if you decide to turn it on in config.php.
  7. Add a directory called /images/ where all theme-related images are to be stored. This separates the Moodle core images (icons, tabs, etc.), which are in the /pix/ directory from your theme images in case you want to update those core files down the road.

Get Stripdown

5 Comments

  1. [...] of us Moodlers a great resource to use when beginning to customize a Moodle theme. He has “created a new theme – an antitheme really – for workshop attendees to use as a starting point for their [...]

  2. Aldrin wrote:

    I followed everything you said but I couldn’t make it work. I also downloaded the stripdown theme, installed it and edit the css. Still it won’t work.

  3. Hello Aldrin,

    This is the file that I use to start every theme that I create. I don’t think it’s a problem there. In any case, I recommend posting the specifics of any problems that you’re having in the Moodle Themes forum, where I’m sure someone has shared your experience and will be able to help you out.

  4. [...] on my Stripdown theme concept, I added a single stylesheet to config.php called styles.css. If you look in that [...]

  5. [...] on my Stripdown theme concept, I added a single stylesheet to config.php called styles.css. If you look in that [...]

Leave a Comment




Feel free to use the following tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>