<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>templatebody</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"> templatebody </span> </span> </div> </div> <div id="pagebody"> <div id="content" role="main"> <p>The <code>templatebody</code> directive is supplied by the <a href="http://ikiwiki.info/plugins/templatebody/">templatebody</a> plugin.</p> <p>This directive allows wiki pages to be used as templates for the <a href="./template.html">template</a> or <a href="./edittemplate.html">edittemplate</a> directive, without having <a href="http://search.cpan.org/search?mode=dist&query=HTML%3A%3ATemplate">HTML::Template</a> markup interpreted as wiki markup when that page is built.</p> <p>This directive does not produce any output in the wiki page that defines the template; the rest of that page can be used to to document how to use the template.</p> <p>The first, un-named parameter is the content of the template. Because templates often contain <a href="../directive.html">directives</a>, it's convenient to use the "here-document" syntax for it:</p> <pre><code>[[!templatebody <<ENDBODY [[!meta title="<TMPL_VAR name>"]] [[!tag person]] <dl> <dt>Name:</dt><dd><TMPL_VAR name></dd> <dt>Age:</dt><dd><TMPL_VAR age></dd> </dl> <TMPL_VAR description> ENDBODY]] </code></pre> </div> </div> <div id="footer" class="pagefooter" role="contentinfo"> <div id="pageinfo"> <div id="backlinks"> Links: <a href="./edittemplate.html">edittemplate</a> <a href="../../plugins/templatebody.html">plugins/templatebody</a> <a href="../../plugins/write.html">plugins/write</a> <a href="./template.html">template</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>