Skip to content

Commit 73dd98e

Browse files
authored
Customized templates (ltb-project#227)
1 parent c2760c4 commit 73dd98e

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

conf/config.inc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@
280280
#$logout_link = "http://auth.example.com/logout";
281281
$fake_password_inputs = false;
282282

283+
# Customized template directory: to override some templates files
284+
$custom_tpl_dir = "";
285+
283286
# Audit
284287
#$audit_log_file = "/var/log/service-desk/audit.log";
285288
$use_showauditlog = false;

docs/general-parameters.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ To enable this trick:
151151
152152
$fake_password_inputs = true;
153153
154+
Custom templates
155+
^^^^^^^^^^^^^^^^
156+
157+
If you need to do more changes on the interface, you can create a custom templates directory
158+
and override any of template file by copying it from ``templates/`` into the custom directory
159+
and adapt it to your needs:
160+
161+
.. code-block:: php
162+
163+
$custom_tpl_dir = "templates_custom/";
164+
154165
Debug
155166
-----
156167

htdocs/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@
126126

127127
$compile_dir = isset($smarty_compile_dir) && $smarty_compile_dir ? $smarty_compile_dir : "../templates_c/" ;
128128
$cache_dir = isset($smarty_cache_dir) && $smarty_cache_dir ? $smarty_cache_dir : "../cache/";
129+
$tpl_dir = isset($custom_tpl_dir) ? array('../'.$custom_tpl_dir, '../templates/') : '../templates/';
129130

130131
$smarty = new Smarty();
131132
$smarty->escape_html = true;
132-
$smarty->setTemplateDir('../templates/');
133+
$smarty->setTemplateDir($tpl_dir);
133134
$smarty->setCompileDir($compile_dir);
134135
$smarty->setCacheDir($cache_dir);
135136
$smarty->debugging = $smarty_debug;

0 commit comments

Comments
 (0)