Allow /local and custom theme override of Plugin templates
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Aaron Wells |
Bug Description
One of the handiest features for site admins to tweak their Mahara site without making hacks that make upgrades difficult, is the relatively obscure local theme overrides feature: https:/
Theme support is there, but you have to put the theme template dirctories under the plugin's own theme directory. i.e. artefact/
I propose the following:
1. We allow for /local overrides of plugin templates. The path should be local/theme/
So:
local/theme/
local/theme/
2. For custom themes, we take a similar approach: theme/{
theme/aaronsthe
theme/aaronsthe
And in order of precedence:
1. /local theme overrides
2. custom theme located under /theme directory
3. theme template files locate under plugin's directory
Changed in mahara: | |
milestone: | 1.9rc1 → 1.9.0 |
Changed in mahara: | |
importance: | Wishlist → Medium |
Changed in mahara: | |
milestone: | 1.9.0 → 1.10.0 |
Changed in mahara: | |
status: | Confirmed → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Hm, I've taken a crack at implementing this, and I've got a system working for templates as described above. But, I realize I need to do something similar for static assets, i.e. images and stylesheets.
Which brings up a question of directory structures. Within the custom theme directory, should we have a directory for each plugin, each with its own "templates" and "static" subdirectories? Or, within the theme's main "templates" and "static" subdirectories should there be a separate directory for each plugin?
Option 1: Multiple "templates" and "static" subdirectories:
theme/
+- raw/
+- templates/
+- index.tpl
+- static/
+- images/
+- mahara--logo.png
+- blocktype/
+- clippy/
+- templates/
+- clippy.tpl
+- images/
+- thumb.png
+- creativecommons/
+- templates/
+- summary.tpl
+- assets/
+- images/
+- cclogo.png
Option 2: Multiple plugin subdirectories
theme/
+- raw/
+- templates/
+- index.tpl
+- blocktype/
+- clippy/
+- clippy.tpl
+- creativecommons/
+- summary.tpl
+- static/
+- images/
+- mahara-logo.png
+- blocktype/
+- clippy/
+- images/
+- thumb.png
+- creativecommons
+- images/
+- cclogo.png
Basically the choice comes down to grouping files together by type (static v templates) or grouping them together by plugin.