From 7fcde3b9b8fd8d14be094aed02d40845df602a95 Mon Sep 17 00:00:00 2001 From: Mickael Desgranges Date: Fri, 3 Jul 2015 16:13:40 +0200 Subject: [PATCH 1/5] add a path for overriding templates add the possibility to override all templates by adding a new one with the same relative paths and name in /main/template/overrides/ directory This is useful when you want customize a view and keep all change at the next upgrade (without putting your shoes in the bathtub) --- main/inc/lib/template.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index 1ae2028182..7726a33b05 100755 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -66,7 +66,7 @@ class Template $this->load_plugins = $load_plugins; $template_paths = array( - api_get_path(SYS_PATH) . 'custompages', // custom pages folder + api_get_path(SYS_PATH) . 'overrides', // user defined templates api_get_path(SYS_CODE_PATH).'template', //template folder api_get_path(SYS_PLUGIN_PATH) //plugin folder ); From d70a0c286e63cae3cca19ed871d3d014ff01d025 Mon Sep 17 00:00:00 2001 From: Mickael Desgranges Date: Fri, 3 Jul 2015 16:19:52 +0200 Subject: [PATCH 2/5] Create README.md --- main/template/overrides/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 main/template/overrides/README.md diff --git a/main/template/overrides/README.md b/main/template/overrides/README.md new file mode 100644 index 0000000000..4ac456a23d --- /dev/null +++ b/main/template/overrides/README.md @@ -0,0 +1,9 @@ +This directory is the right place for override an existing template. + +Just copy the orginal template with the same relative path. +ex: +``` +default/layout/head.tpl + +the_plugin_dirnae_name/path/of/template/in/plugins.tpl +``` From 36b8de9bcd018a612303a88b0d2183ef2dbb7a31 Mon Sep 17 00:00:00 2001 From: Mickael Desgranges Date: Fri, 3 Jul 2015 16:20:29 +0200 Subject: [PATCH 3/5] Update README.md --- main/template/overrides/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/template/overrides/README.md b/main/template/overrides/README.md index 4ac456a23d..a19e93edeb 100644 --- a/main/template/overrides/README.md +++ b/main/template/overrides/README.md @@ -1,6 +1,6 @@ This directory is the right place for override an existing template. -Just copy the orginal template with the same relative path. +Just copy the orignal template with the same relative path. ex: ``` default/layout/head.tpl From aa115cc7ccaea9924c8cc083180b7d4c20ecdffc Mon Sep 17 00:00:00 2001 From: Mickael Desgranges Date: Fri, 3 Jul 2015 16:33:11 +0200 Subject: [PATCH 4/5] Update template.lib.php --- main/inc/lib/template.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index 7726a33b05..f3f93be5ab 100755 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -66,7 +66,7 @@ class Template $this->load_plugins = $load_plugins; $template_paths = array( - api_get_path(SYS_PATH) . 'overrides', // user defined templates + api_get_path(SYS_CODE_PATH) . 'overrides', // user defined templates api_get_path(SYS_CODE_PATH).'template', //template folder api_get_path(SYS_PLUGIN_PATH) //plugin folder ); From 1923857b7473cdb231ebf8f37034edbb653e0ca3 Mon Sep 17 00:00:00 2001 From: Mickael Desgranges Date: Fri, 3 Jul 2015 16:51:40 +0200 Subject: [PATCH 5/5] Update template.lib.php --- main/inc/lib/template.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index f3f93be5ab..395cc95186 100755 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -66,7 +66,7 @@ class Template $this->load_plugins = $load_plugins; $template_paths = array( - api_get_path(SYS_CODE_PATH) . 'overrides', // user defined templates + api_get_path(SYS_CODE_PATH) . 'template/overrides', // user defined templates api_get_path(SYS_CODE_PATH).'template', //template folder api_get_path(SYS_PLUGIN_PATH) //plugin folder );