Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > d8544620e4ac7bee48ddb48c85d55709 > files > 101

ikiwiki-3.20190228-1.mga7.noarch.rpm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>edittemplate</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="../../style.css" type="text/css" />

<link rel="stylesheet" href="../../local.css" type="text/css" />






<meta name="robots" content="noindex, follow" />



</head>
<body>

<div class="page">

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

<a href="../../index.html">ikiwiki</a>/ 

<a href="../../ikiwiki.html">ikiwiki</a>/ 

<a href="../directive.html">directive</a>/ 

</span>
<span class="title">
edittemplate

</span>
</span>



</div>









</div>





<div id="pagebody">

<div id="content" role="main">
<p>The <code>edittemplate</code> directive is supplied by the <a href="http://ikiwiki.info/plugins/edittemplate/">edittemplate</a> plugin.</p>

<p>This directive allows registering template pages, that provide default
content for new pages created using the web frontend. To register a
template, insert an <span class="selflink">edittemplate</span> directive on some other
page.</p>

<pre><code>[[!edittemplate  template="bugtemplate" match="bugs/*"]]
</code></pre>

<p>A recommended place to put the directive is on the parent page
of the pages that will be created using the template. So the above
example would be put on the bugs page. (Do not put the directive on the
template page itself.)</p>

<p>In the above example, the page named "bugtemplate" is registered as a
template to be used when any page named "bugs/*" is created. To avoid
the directive displaying a note about the template being registered, add
"silent=yes".</p>

<p>Often the template page contains a simple skeleton for a particular type of
page, wrapped in a <a href="./templatebody.html">templatebody</a> directive. For the bug report pages in
the above example, it might look something like:</p>

<pre><code>[[!templatebody  &lt;&lt;ENDBODY
Package: 
Version: 
Reproducible: y/n
Details:
ENDBODY]]
</code></pre>

<p>The template page can also contain <a href="http://search.cpan.org/search?mode=dist&amp;query=HTML%3A%3ATemplate">HTML::Template</a> directives,
like other ikiwiki <a href="../../templates.html">templates</a>.</p>

<p>These variables might be set:</p>

<ul>
<li><p><code>&lt;TMPL_VAR name&gt;</code> is replaced with the name of the page being
created.</p></li>
<li><p><code>&lt;TMPL_VAR uuid&gt;</code> is replaced with a version 4 (random) UUID
suitable for use in <code>[[!meta  guid="urn:uuid:&lt;TMPL_VAR uuid&gt;"]]</code>.
(Requires the <code>UUID::Tiny</code> Perl module if not running on Linux.)</p></li>
<li><p><code>&lt;TMPL_VAR time&gt;</code> is replaced with the current (template generation)
time using a fixed format (RFC 3339, <code>%Y-%m-%dT%H:%M:%SZ</code>),
suitable for use in <code>[[!meta  date="&lt;TMPL_VAR time&gt;"]]</code>
(see <a href="./meta.html">meta</a>) or <code>[[!date  "&lt;TMPL_VAR time&gt;"]]</code> (see <a href="./date.html">date</a>).</p></li>
</ul>

<p>Text outside the <a href="./templatebody.html">templatebody</a> directive is not part of the template,
and can be used to document it.</p>

<p>If the template does not contain a <a href="./templatebody.html">templatebody</a> directive, the entire
source of the page is used for the template. This is deprecated.</p>

</div>







</div>

<div id="footer" class="pagefooter" role="contentinfo">

<div id="pageinfo">






<div id="backlinks">
Links:

<a href="../../plugins/edittemplate.html">plugins/edittemplate</a>

<a href="./templatebody.html">templatebody</a>


</div>






<div class="pagedate">
Last edited <span class="date">Tue Feb 26 23:01:54 2019</span>
<!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> -->
</div>

</div>


<!-- from ikiwiki -->
</div>

</div>

</body>
</html>