Plugin IncludeTpl

Introduced in Tiki15

Use this wiki plugin to include a template file in a page

Parameters

Include a Smarty template (.tpl) file in a page
Introduced in Tiki 15.
Go to the source code

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

Examples

Example 1

This code:

Copy to clipboard
{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.

Example 2 with a Wiki Page Template

You can also use a Smarty template in a wiki page like this:

Copy to clipboard
{includetpl filename="wiki: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.

Aliases

Plugin IncludeTpl | Plugin Include Tpl