<br><font size=2 face="sans-serif">Hello,</font>
<br>
<br><font size=2 face="sans-serif">I've modified the newpageform recipe so that it just shows a dropdown menu and a field for the name of the new page.</font>
<br><font size=2 face="sans-serif">and also show a template for each group when it brings the edit page. But I guess the modifications I've made </font>
<br><font size=2 face="sans-serif">disables the search function. </font>
<br><font size=2 face="sans-serif">Here are the changes I made to the NewPageFunction:</font>
<br>
<br><font size=2 face="Courier New">function NewPageForm($pagename) {</font>
<br><font size=2 face="Courier New">global $NewGroup;</font>
<br><font size=2 face="Courier New">// &nbsp;$PageUrl = PageVar($pagename, '$PageUrl');</font>
<br><font size=2 face="Courier New">&nbsp;$out[] = &quot;&lt;form method='post'&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &lt;input type='hidden' name='action' value='postnewpage'/&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &lt;table &gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;Group:</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;select name='group'&gt;&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; foreach($NewGroup as $k=&gt;$v) {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; $x = is_string($k) ? $k : $v;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; $out[] = &quot;&lt;option value='$x'&gt;$v&lt;/option&gt;&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; } &nbsp;</font>
<br><font size=2 face="Courier New">&nbsp; $out [] = &quot;&lt;/table&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;form method='post'&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type='hidden' name='action' value='postnewpage' /&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;Pagename:</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;input type='text' name='newpagename'&gt;&lt;/td&gt;&lt;/tr&gt;&quot;; </font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;$out[] = &quot;&lt;/table&gt;&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; return FmtPageName(implode('',$out),$pagename);</font>
<br><font size=2 face="Courier New">}</font>
<br>
<br><font size=2 face="Courier New">And I added 3 lines to the end of the first else:</font>
<br><font size=2 face="Courier New">$_REQUEST ['template'] = $_REQUEST ['group'].'.Template';</font>
<br><font size=2 face="Courier New">$urlfmt = '$PageUrl?action=edit&amp;template='.&quot;{$_REQUEST ['template']}&quot;;</font>
<br><font size=2 face="Courier New">Redirect($pagename, $urlfmt);</font>
<br>
<br>
<br><font size=2 face="Courier New">Bellow is the whole recipe in case it's needed.</font>
<br><font size=2 face="Courier New">Thanks</font>
<br><font size=2 face="Courier New">Naeimeh </font>
<br><font size=2 face="Courier New">&nbsp; </font>
<br>
<br>
<br>
<br>
<br><font size=2 face="Courier New">&lt;?php if (!defined('PmWiki')) exit();</font>
<br><font size=2 face="Courier New">$NewGroup = array('Select Category', 'Dalsa','DigitalCinema', 'Electronics', 'Finance', &nbsp;'Sensor', 'TechnicalMarketing', 'Testing');</font>
<br><font size=2 face="Courier New">markup('newpageform','inline','/\\(:newpageform:\\)/e',&quot;Keep(NewPageForm(\$pagename))&quot;);</font>
<br><font size=2 face="Courier New">## NewPageForm() generates the form for entering a new page. &nbsp;Note that</font>
<br><font size=2 face="Courier New">## once a page has been created, it's a normal wikipage and is edited</font>
<br><font size=2 face="Courier New">## according to the normal editing code (i.e., there's no form-based</font>
<br><font size=2 face="Courier New">## editing yet).</font>
<br><font size=2 face="Courier New">function NewPageForm($pagename) {</font>
<br><font size=2 face="Courier New">global $NewGroup;</font>
<br><font size=2 face="Courier New">// &nbsp;$PageUrl = PageVar($pagename, '$PageUrl');</font>
<br><font size=2 face="Courier New">&nbsp;$out[] = &quot;&lt;form method='post'&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &lt;input type='hidden' name='action' value='postnewpage'/&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &lt;table &gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;Group:</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;select name='group'&gt;&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; foreach($NewGroup as $k=&gt;$v) {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; $x = is_string($k) ? $k : $v;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; $out[] = &quot;&lt;option value='$x'&gt;$v&lt;/option&gt;&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; } &nbsp;</font>
<br><font size=2 face="Courier New">&nbsp; $out [] = &quot;&lt;/table&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;form method='post'&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type='hidden' name='action' value='postnewpage' /&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table width=18% &gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;Pagename:</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;input type='text' name='newpagename'&gt;&lt;/td&gt;&lt;/tr&gt;&quot;;</font>
<br>
<br><font size=2 face="Courier New">&nbsp;/* $out[] = &quot;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&lt;td valign='top'&gt;$[NewPage]:&lt;/td&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;textarea name='description' cols='60' rows='15'&gt;&lt;/textarea&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &lt;div align='center'&gt;&lt;input type='submit' value='$[submit new page]' /&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp;&lt;/div&gt;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp;&lt;/form&gt;&quot;;*/ &nbsp;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp;$out[] = &quot;&lt;/table&gt;&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; return FmtPageName(implode('',$out),$pagename);</font>
<br><font size=2 face="Courier New">}</font>
<br>
<br><font size=2 face="Courier New">$HTMLStylesFmt[] = &quot;.pitsfield { text-align:right; font-weight:bold; }\n&quot;;</font>
<br>
<br><font size=2 face="Courier New">include_once(&quot;$FarmD/scripts/author.php&quot;);</font>
<br>
<br><font size=2 face="Courier New">if ($action=='postnewpage') {</font>
<br><font size=2 face="Courier New">//$_REQUEST ['template'] = $_REQUEST ['group'].'.Template'; </font>
<br><font size=2 face="Courier New">$pagename = &quot;{$_REQUEST ['group']}.&quot;.&quot;{$_REQUEST ['newpagename']}&quot;;</font>
<br><font size=2 face="Courier New">&nbsp;if (!PageExists($pagename))</font>
<br><font size=2 face="Courier New">&nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ($_REQUEST ['group'] == &quot;&quot;) {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$pagename = &quot;Main.&quot;.&quot;{$_REQUEST ['newpagename']}&quot;;}</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp;if ($_REQUEST ['group'] == &quot;PITS&quot;) {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Abort(&quot;cannot create pages in PITS. Please use the PITS Form for a new issue. It's located at $ScriptUrl/PITS/PITS &quot;);}</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($_REQUEST ['newpagename'] == &quot;&quot;) {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; $UrlPage=&quot;{$_REQUEST ['group']}&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; Redirect($PageNotFound);}</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; else</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp;Lock(2);</font>
<br><font size=2 face="Courier New">//echo($urlfmt);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $action = 'edit';</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_REQUEST['post'] = 1;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $CreateTime = strftime('%Y-%m-%d %H:%M',$Now);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $EditMessageFmt = &quot;&lt;p class='vspace'&gt;Please review and make any edits </font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; to your issue below, then press 'Save'&lt;/p&gt;&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_POST['text'] = &quot;{$_REQUEST['description']}&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$_REQUEST ['template'] = $_REQUEST ['group'].'.Template';</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$urlfmt = '$PageUrl?action=edit&amp;template='.&quot;{$_REQUEST ['template']}&quot;;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Redirect($pagename, $urlfmt);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; else</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// echo($urlfmt);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Redirect($pagename);</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; </font>
<br><font size=2 face="Courier New">}</font>
<br><font size=2 face="Courier New">?&gt;</font>
<br>
<p><span style="font-family:'Arial';font-size:8pt;">**********************************************************************</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">To help combat SPAM DALSA will no longer return delivery failure notifications for incorrect or invalid addresses.</span></p>
<p><span style="font-family:'Arial';font-size:8pt;"></span></p>
<p><span style="font-family:'Arial';font-size:8pt;">&nbsp;</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">This email and any files transmitted with it are confidential and</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">intended solely for the use of the individual or entity to whom they</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">are addressed. If you have received this email in error please notify</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">the system manager.</span></p>
<p><span style="font-family:'Arial';font-size:8pt;"></span></p>
<p><span style="font-family:'Arial';font-size:8pt;">&nbsp;</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">This email message has also been swept for the presence of computer viruses</span></p>
<p><span style="font-family:'Arial';font-size:8pt;"></span></p>
<p><span style="font-family:'Arial';font-size:8pt;">&nbsp;</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">Please note that DALSA employee addresses have been standardized to dalsa.com-- Please update your address book as may be required</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">**********************************************************************</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">&nbsp;</span></p>