Skip to content

Commit ba1c1e4

Browse files
committed
Add doc for custom template parameters
1 parent 17a8523 commit ba1c1e4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/general-parameters.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ and adapt it to your needs:
150150
151151
$custom_tpl_dir = "templates_custom/";
152152
153+
To define a custom template paramter, create a config parameter with ``tpl_`` prefix:
154+
155+
.. code-block:: php
156+
157+
$tpl_mycustomparam = true;
158+
159+
And then use it in template:
160+
161+
.. code-block:: html
162+
163+
<div>
164+
{if $mycustomparam}
165+
<p>Display this</p>
166+
{else}
167+
<p>Display that</p>
168+
{/if}
169+
153170
Default page
154171
^^^^^^^^^^^^
155172

0 commit comments

Comments
 (0)