Skip to content
sebbacon edited this page Jun 17, 2011 · 12 revisions

A theme is a set of customisations to the user interface, packaged so you don't have to change the core code to make them work.

There's an example theme which can be used as a template, and you could also look at the standard WhatDoTheyKnow

As described in the README in the template theme, you can install these themes (they look quite similar!) with the commands

./script/plugin install git://github.com/sebbacon/alavetelitheme.git

Or

./script/plugin install git://github.com/mysociety/whatdotheyknow-theme.git

The plugin install script downloads the theme from the specified URL and then puts it in vendor/plugins.

In turn, the plugin simply tells Rails to look in its own templates folder at lib/views/ for templates first, before looking elsewhere. Thus it's possible to create custom layouts, custom help pages, and there's also a place to put custom CSS (lib/views/general/custom_css.rhtml).

##TODO

  • Themes don't yet know how to provide image resources
  • Themes should also be able to override or extend controller logic in some limited sense
  • Behaviour when two themes are installed is as yet undefined (one will take precedence over the other). There should be some mechanism to switch between installed themes.
Clone this wiki locally