[Pmwiki-users] Moving author field to the top
Patrick R. Michaud
pmichaud
Mon Mar 1 20:36:34 CST 2004
On Tue, Mar 02, 2004 at 04:07:14PM +1300, Robin Sheat wrote:
> On Mon, Mar 01, 2004 at 08:01:09PM -0700, Patrick R. Michaud wrote:
> > Since many people are asking "how do I make the author field compulsory?",
> > I'll add an option for this to the next release of PmWiki (in a day or so).
> That would probably be good. However, is is possible to shift it. I want
> to see if it being at the top works better by virtue of being more
> obvious.
Yes, it's possible to shift. There's two ways to do it:
1. Set a new value for $PageEditFmt in config.php:
$PageEditFmt=array("
<div id='wikiedit'>
<a id='top' name='top'></a><h1 class='wikiaction'>$[Editing \$PageName]</h1>
<form action='\$PageUrl' method='post'>
<input type='hidden' name='pagename' value='\$PageName' />
<input type='hidden' name='action' value='edit' />
$[Author]: <input type='text' name='author' value='\$Author' /><br />
<textarea name='text' rows='25' cols='60'
onkeydown='if (event.keyCode == 27) event.returnValue=false;'
>\$Text</textarea><br />
<input type='checkbox' name='diffclass' value='minor' \$DiffClassMinor />
$[This is a minor edit]<br />
<input type='submit' name='post' value=' $[Save] ' />
<input type='submit' name='preview' value=' $[Preview] ' />
<input type='reset' value=' $[Reset] ' />
</form></div>",'wiki:$[PmWiki.EditQuickReference]');
This is the same as the default $PageEditFmt except the author field
is moved before the textarea instead of after it.
2. Set a new value for $PageEditFmt in your layout template(s):
<!--PageEditFmt-->
<div id='wikiedit'>
<a id='top' name='top'></a><h1 class='wikiaction'>$[Editing $PageName]</h1>
<form action='$PageUrl' method='post'>
<input type='hidden' name='pagename' value='$PageName' />
<input type='hidden' name='action' value='edit' />
$[Author]: <input type='text' name='author' value='$Author' /><br />
<textarea name='text' rows='25' cols='60'
onkeydown='if (event.keyCode == 27) event.returnValue=false;'
>$Text</textarea><br />
<input type='checkbox' name='diffclass' value='minor' $DiffClassMinor />
$[This is a minor edit]<br />
<input type='submit' name='post' value=' $[Save] ' />
<input type='submit' name='preview' value=' $[Preview] ' />
<input type='reset' value=' $[Reset] ' />
</form></div>
<!--wiki:$[PmWiki.EditQuickReference]-->
which effectively does the same as #1 above.
Pm
More information about the pmwiki-users
mailing list