Commit 2ab3ed09 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Allow custom templates to be added to all themes (bug #898437)

Sometimes it is useful for a site which has multiple themes in use to
be able to add a custom template (for example, a custom sideblock)
that appears in all themes, including the core themes and the raw

This patch adds local/theme/templates/ to the template search path, as
a fallback for when a template is not found in any of the theme

It is usually possible to achieve the same thing by putting the custom
template in the raw theme, but it is cleaner to keep them outside the
raw theme, and custom themes should not be required to inherit from
raw anyway.

Change-Id: I4f188ae3985741183d1c04f71c6c42e3ca4675cf
Signed-off-by: default avatarRichard Mansfield <>
parent 38d9b941
......@@ -745,6 +745,8 @@ class Theme {
$this->templatedirs[] = get_config('docroot') . 'theme/' . $this->basename . '/templates/';
$this->inheritance[] = $this->basename;
$this->templatedirs[] = get_config('docroot') . 'local/theme/templates/';
// Now go through the theme hierarchy assigning variables from the
// parent themes
$currenttheme = $this->basename;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment