Forums | Mahara Themes

General discussion /
Theme changes in Mahara 1.10!


Aaron Wells's profile picture
Posts: 896

23 October 2014, 17:20

We've made a couple of changes to themes in Mahara 1.10, which may affect theme developers.

1. Themes can have lang strings

If you're only a theme developer and not a plugin developer, you may not be aware of what "lang strings" are in Mahara. They're the way that we store text strings that are meant to be displayed to the end user. They get stored off in separate files in order to make translation easier.

Mahara already supported core lang strings (under htdocs/lang) and plugin lang strings (under, for instance, htdocs/blocktype/creativecommons/lang) and local lang overrides (under htdocs/local/lang). Well, now themes too can ship with their own lang strings.

The core theme that required this was the "Primary School" theme, which has some words in its homeinfo.tpl file. Previously these were hard-coded English words, now they're translatable lang strings. So take a look at htdocs/theme/primaryschool if you want to see an example of how it's done.

2. Themes can include files for plugins

Say you wanted to change the thumbnails used for all the block types on the Mahara page editor. Well previously these were stored under the plugin, for instance htdocs/blocktype/creativecommons/theme/aaronstheme/static/images/thumb.png . So if you wanted to update these as part of your custom theme, you'd have to ask the user while installing to copy a separate thumb.png into every single plugin directory. And even trickier if you wanted to support 3rd-party plugins!

Under 1.10, such "plugin files" can now live under the theme directory as well! So you can put it in htdocs/theme/aaronstheme/blocktype/creativecommons/static/images/thumb.png . This means you can distribute plugin theme files with your 3rd-party theme, all in one directory!

See https://bugs.launchpad.net/mahara/+bug/1231755 a possibly clearer explanation

3. Local theme overrides

If you just want to quickly change one thing in Mahara, without the overhead of creating a whole theme, you can now do that by placing files under htdocs/local/theme.

 

See https://wiki.mahara.org/index.php/Customising/Themes/1.10 for all the gory details. Smile

1 result