Introduced in Tiki15
Use this wiki plugin to include a template file in a page
Parameters | Accepted Values | Description | Default | Since |
---|---|---|---|---|
filename |
text | If you need to include Smarty template files. | 15.0 | |
values |
text | Values to be passed to tpl file, for example values=var1:val1&var2:val2 , which can then be accessed in the Smarty template file as {$values.var1} and {$values.var2} |
15.0 |
This code:
{includetpl filename="credits.tpl" values="var1:foo&var2:wohoo"}
Would produce on this site:
Theme: Fivealive-lite/Kiwi
If you use in your tpl the variables var1 and var2 (as in this example), they would get their values set in the corresponding plugin parameters above (foo and wohoo, correspondingly).
To use those values in a template you would use {$values.var1}
and {$values.var2}
in your Smarty code.
You can also use a Smarty template in a wiki page like this:
{includetpl filename="tplwiki:Tpl Page Name" values="var1:foo&var2:wohoo"}
Make sure you give your page tiki_p_use_as_template
permissions and make it only editable by trusted users.
Plugin IncludeTpl | Plugin Include Tpl