diff --git a/conf/config.inc.php b/conf/config.inc.php index 53f4f27d9..96c3500e6 100644 --- a/conf/config.inc.php +++ b/conf/config.inc.php @@ -406,6 +406,9 @@ $custom_css = ""; $display_footer = true; +# Customized template directory: to ovverride some templates files +$custom_tpl_dir = ""; + # Where to log password resets - Make sure apache has write permission # By default, they are logged in Apache log #$reset_request_log = "/var/log/self-service-password"; diff --git a/docs/config_general.rst b/docs/config_general.rst index 3468b8e93..08642e013 100644 --- a/docs/config_general.rst +++ b/docs/config_general.rst @@ -174,6 +174,17 @@ You can hide the footer bar: $display_footer = false; +Custom templates +^^^^^^^^^^^^^^^^ + +If you need to do more changes on the interface, you can create a custom templates directory +and override any of template file by copying it from ``templates/`` into the custom directory +and adapt it to your needs: + +.. code-block:: php + + $custom_tpl_dir = "templates_custom/"; + Debug ----- diff --git a/htdocs/index.php b/htdocs/index.php index 060668dbb..0754d4eca 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -256,10 +256,11 @@ $compile_dir = isset($smarty_compile_dir) ? $smarty_compile_dir : "../templates_c/"; $cache_dir = isset($smarty_cache_dir) ? $smarty_cache_dir : "../cache/"; +$tpl_dir = isset($custom_tpl_dir) ? array('../'.$custom_tpl_dir, '../templates/') : '../templates/'; $smarty = new Smarty(); $smarty->escape_html = true; -$smarty->setTemplateDir('../templates/'); +$smarty->setTemplateDir($tpl_dir); $smarty->setCompileDir($compile_dir); $smarty->setCacheDir($cache_dir); $smarty->debugging = $smarty_debug;