<?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  /  Create Page Plugin</title>
</head>
<body>

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



<div class="wikitext"><p class="tightenable top"><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> to easily create new pages, optionally with default content. Since v1.3.8</p>
<p class="tightenable">This allows you to create a page geting the new pagename from a
forms-based interface, and optionally with the initial content from
some template.</p>
<p class="tightenable">Put a &quot;&lt;?plugin-form CreatePage ?&gt;&quot; at some page, browse this page,
enter the name of the page to create, then click the button.</p>
<h3>Usage</h3>
<pre class="tightenable top">
     &lt;?plugin-form CreatePage ?&gt;
     &lt;?plugin-form CreatePage template=CategoryHomePage ?&gt;
     &lt;?plugin-form CreatePage template=SomeTemplatePage vars=&quot;year=2004&amp;name=None&quot; ?&gt;</pre>
<h3>Plugin Arguments</h3>
<table class="wiki-dl-table" border="1" cellspacing="0" cellpadding="6"><tr class="tightenable top bottom"><th><b>s</b>:</th>
<td>The pagename, which will passed to the plugin. Default: &quot;&quot;</td>
</tr>
<tr class="tightenable top bottom"><th><b>initial_content</b>:</th>
<td>The new page will be pre-filled with this content. Default: &quot;&quot;</td>
</tr>
<tr class="tightenable top bottom"><th><b>template</b>:</th>
<td>The new page will be pre-filled with the content of this page. Default: &quot;&quot;</td>
</tr>
<tr class="tightenable top bottom"><th><b>vars</b>:</th>
<td>variables to be expanded. Default: &quot;&quot;</td>
</tr>
<tr class="tightenable top"><th><b>overwrite</b>:</th>
<td>Whether to overwrite an existing page. Default: &quot;&quot;</td>
</tr>
</table>
<h3>Known Problems</h3>
<p class="tightenable">None</p>
<h3>Variable Expansion</h3>
<p class="tightenable">The content (either initial_content or template) might hold some variables, which will be
expanded on creation. Unassigned variables will stay as %%&lt;var&gt;%%, assigned variables without
matching %%&lt;var&gt;%% placeholder will be ignored, without any warning.</p>
<p class="tightenable">A variable in a template is denoted as <tt>%%var%%</tt>, which will be expanded by the
value of <tt>var</tt> given to the vars argument (in urlencoded php notation).</p>
<p class="tightenable">Some special variables are automatically assigned:</p>
<table class="wiki-dl-table" border="1" cellspacing="0" cellpadding="6"><tr class="tightenable bottom"><th>%%ctime%%</th>
<td>$<u title="Empty link to: WikiTheme" onmouseover="window.status=&quot;Empty link to: WikiTheme&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">WikiTheme</u>-&gt;formatDateTime(time())</td>
</tr>
<tr class="tightenable top"><th>%%author%%</th>
<td>$user-&gt;getId()</td>
</tr>
</table>
<p class="tightenable">This forms together with page templates and the <a href="http://phpwiki.sourceforge.net/phpwiki/WikiFormRichPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">WikiFormRichPlugin</span></a> and
optionally the <a href="http://phpwiki.sourceforge.net/phpwiki/SqlResultPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">SqlResultPlugin</span></a> a framework to create templated pages.</p>
<h3>Authors</h3>
<p class="tightenable">Dan Frankowski, Reini Urban</p>
<h3>Examples</h3>
<div class="plugin tightenable" id="CreatePagePlugin5"><form action="CreatePage.html" method="get" class="wikiaction" accept-charset="iso-8859-1">
<div class="wikiaction"><input name="s" value="MyHomePage" type="text" size="30" title="Create a Wiki page by the provided name." onmouseover="window.status=&quot;Create a Wiki page by the provided name.&quot;; return true;" onmouseout="window.status='';return true;" /><input type="submit" class="button" value="CreatePage" /></div>
</form>
</div>
<p class="tightenable">See also <a href="http://phpwiki.sourceforge.net/phpwiki/EasilyCreateNewPages" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">EasilyCreateNewPages</span></a>, <a href="http://phpwiki.sourceforge.net/phpwiki/WikiFormRichPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">WikiFormRichPlugin</span></a>, <a href="http://phpwiki.sourceforge.net/phpwiki/SqlResultPlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />PhpWiki:</span><span class="wikipage">SqlResultPlugin</span></a></p>
<hr />
<p class="tightenable 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>
