← Back to team overview

mahara-contributors team mailing list archive

[Bug 1231755] A change has been merged

 

Reviewed:  https://reviews.mahara.org/3425
Committed: http://gitorious.org/mahara/mahara/commit/fd85506f254ebc3675718ce54029ff96a4c13856
Submitter: Yuliya Bozhko (yuliya.bozhko@xxxxxxxxx)
Branch:    master

commit fd85506f254ebc3675718ce54029ff96a4c13856
Author: Aaron Wells <aaronw@xxxxxxxxxxxxxxx>
Date:   Mon Jun 9 20:24:58 2014 +1200

Allow plugin theme files to live under the /theme and /local directory

Bug 1231755. In order to make it easier for custom theme authors to customize
the appearance of plugins, I'm adding the /theme directory to the search path
for plugin files.

Example: smarty->display('artefact:fun:path/to/file.tpl')

Old searchpath:

/artefact/fun/theme/(themename)/path/to/file.tpl

New searchpath (in order of precedence):

1. /local/theme/artefact/fun/templates/path/to/file.tpl
2. /theme/(themename)/artefact/fun/templates/path/to/file.tpl
3. /artefact/fun/theme/(themename)/path/to/file.tpl

Further notes:

The /local directory doesn't have separate copies for separate
themes. It's a sitewide override of all themes.

For some reason theme directories under plugins don't have a "templates"
directory. The templates sit loose under the theme directory. In my new
version, plugin directories under themes DO have a "templates" directory.

Change-Id: Id90ee1d1dec0bda93a0d30e54229fd7dacbe5b96

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1231755

Title:
  Allow /local and custom theme override of Plugin templates

Status in Mahara ePortfolio:
  Confirmed

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://wiki.mahara.org/index.php/Customising/Themes/1.2#Local_theme_overrides

  Theme support is there, but you have to put the theme template
  dirctories under the plugin's own theme directory. i.e.
  artefact/internal/theme/primary/static/templates/content.tpl . So,
  this is handy for plugin authors, but not for custom theme developers.

  I propose the following:

  1. We allow for /local overrides of plugin templates. The path should
  be local/theme/templates/{plugintype}/{pluginname}/{template} . Or in
  the case of plugins that live underneath other plugins (i.e.
  blocktypes under artefacts)
  local/theme/templates/{plugintype1}/{pluginname1}/{plugintype2}/{pluginname2}/{template}.

  So:

  local/theme/templates/artefact/internal/content.tpl
  local/theme/templates/artefact/internal/blocktype/textbox/content.tpl

  2. For custom themes, we take a similar approach:
  theme/{themename}/static/templates/{plugintype}/{pluginname}/{template}

  theme/aaronstheme/static/templates/artefact/internal/content.tpl
  theme/aaronstheme/static/templates/artefact/internal/blocktype/textbox/content.tpl

  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

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1231755/+subscriptions


References