<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="home" title="HomePage" href="HomePage.html" />
<link rel="help" title="HowToUseWiki" href="HowToUseWiki.html" />
<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1" />
<link rel="author" title="The PhpWiki Programming Team" href="http://phpwiki.org/ThePhpWikiProgrammingTeam" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="en" />
<meta name="robots" content="noindex,nofollow" />
<meta name="language" content="en" />
<meta name="document-type" content="Public" />
<meta name="document-rating" content="General" />
<meta name="generator" content="PhpWiki" />
<meta name="PHPWIKI_VERSION" content="1.3.14" />

<base href="../" />
<link rel="stylesheet" type="text/css" charset="iso-8859-1" href="phpwiki-printer.css" />
<title>PhpWiki - Help  /  Template Plugin</title>
</head>
<body>

<div id="header">
  
<!-- Page title -->
<h1>Help  /  Template Plugin</h1>
</div>
<div id="content">



<div class="wikitext"><h3>Synopsis</h3>
<p class="tightenable">Template = Parametrized blocks.</p>
<p class="tightenable">Include text from a wiki page and replace certain placeholders by parameters.
Similiar to <a href="CreatePage.html" class="wiki">CreatePage</a> with the template argument, but at run-time.
Similiar to the mediawiki templates but not with the &quot;|&quot; parameter seperator.</p>
<h3>Usage</h3>
<pre class="tightenable top">
  &lt;?plugin Template page=Templates/Footer?&gt;
  &lt;?plugin Template page=Templates/Film vars=&quot;title=SomeFilm&amp;year=1999&quot; ?&gt;
  {{Templates/Film|title=SomeFilm|year=1999}}</pre>
<h3>Plugin Arguments</h3>
<table class="wiki-dl-table" border="1" cellspacing="0" cellpadding="6"><tr class="tightenable top"><th>Argument</th>
<th>Default Value</th>
<td>Description</td>
</tr>
<tr class="tightenable"><th>page</th>
<th>(empty)</th>
<td>pagename to be included as template</td>
</tr>
<tr class="tightenable"><th>vars</th>
<th>(empty)</th>
<td>optional parameters to be expanded inside the template</td>
</tr>
</table>
<dl><dt class="tightenable bottom">! Parameter expansion</dt>
<dd class="tightenable top">vars=&quot;var1=value1&amp;var2=value2&quot;</dd>
</dl>
<p class="tightenable">We only support named parameters, not numbered ones as in mediawiki, and
the placeholder is %%var%% and not {{{var}}} as in mediawiki.</p>
<p class="tightenable bottom">The following predefined variables are automatically expanded if existing:</p>
<pre class="tightenable top">
  pagename
  mtime     - last modified date + time
  ctime     - creation date + time
  author    - last author
  owner
  creator   - first author
  SERVER_URL, DATA_PATH, SCRIPT_NAME, PHPWIKI_BASE_URL and BASE_URL</pre>
<p class="tightenable">&lt;noinclude&gt; .. &lt;/noinclude&gt; is stripped</p>
<h4>In work:</h4>
<ul><li class="tightenable top bottom">ENABLE_MARKUP_TEMPLATE = true: (lib/<u title="Empty link to: InlineParser" onmouseover="window.status=&quot;Empty link to: InlineParser&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">InlineParser</u>.php)
Support a mediawiki-style syntax extension which maps</li>
</ul>
<pre class="tightenable top bottom">
    {{TemplateFilm|title=Some Good Film|year=1999}}</pre>
<blockquote class="tightenable top bottom"><p class="tightenable top bottom">to</p>
</blockquote>
<pre class="tightenable top">
    &lt;?plugin Template page=TemplateFilm vars=&quot;title=Some Good Film&amp;year=1999&quot; ?&gt;</pre>
<h3>Examples</h3>
<pre class="tightenable">
  &lt;?plugin Template page=TemplateExample vars=&quot;title=TestTitle&quot; ?&gt;</pre>
<dl><dt class="tightenable bottom">Standard syntax</dt>
<dd class="tightenable top"><span class="plugin" id="TemplatePlugin"><div class="template"><p class="tightenable top bottom">Describe <u title="Empty link to: TemplateExample" onmouseover="window.status=&quot;Empty link to: TemplateExample&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">TemplateExample</u> here.</p>
</div>
</span></dd>
<dt class="tightenable bottom">Shorter syntax</dt>
<dd class="tightenable top">{{<u title="Empty link to: TemplateExample" onmouseover="window.status=&quot;Empty link to: TemplateExample&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">TemplateExample</u>|title=<u title="Empty link to: TestTitle" onmouseover="window.status=&quot;Empty link to: TestTitle&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">TestTitle</u>}}</dd>
</dl>
<hr />
<p class="tightenable top bottom"><a href="PhpWikiDocumentation.html" class="wiki">PhpWikiDocumentation</a> <a href="Help/WikiPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />Help:</span><span class="wikipage">WikiPlugin</span></a></p>
</div>

<div id="footer">  <hr class="printer" noshade="noshade" />
<p class="editdate">Owner: &quot;admin&quot;  Last edited on August 14, 2007  7:11 am by &quot;The PhpWiki programming team&quot;</p>
</div>

</div>
<!-- Add your Disclaimer here -->
</body>
</html>
