[Home]WikiPatches/BetterEditPage

UseModWiki | WikiPatches | RecentChanges | Preferences

This patch generates IMHO a nicer EditPage? with a higher degree of verbosity. It is particularly nice to attract WikiNewbie?s to participate. So I hope at least.

First, you have to include a new variable: $TFRules

Then put the following line into your config file, if used, (and in the wiki.pl):

 $TFRules     = "TextFormattingRules"; # Name of TextFormatting page

Then change in DoEdit:

...
  print &GetTextArea('text', $oldText, $editRows, $editCols);
  $summary = &GetParam("summary", "*");
  ## Patch begin:
  print "<p>", T('Comment:'),
        $q->textfield(-name=>'summary',
                      -default=>$summary, -override=>1,
                      -size=>60, -maxlength=>200);
  print "<br><br>";
  print $q->submit(-name=>'Preview', -value=>T('Preview')), "\n";
  print ' below, then ';
  print $q->submit(-name=>'Save', -value=>T('Save')), "\n";
  if (&GetParam("recent_edit") eq "on") {
    print $q->checkbox(-name=>'recent_edit', -checked=>1,
                               -label=>T('This is a minor edit.'));
  } else {
    print $q->checkbox(-name=>'recent_edit',
                               -label=>T('This is a minor edit.'));
  }

  if ($EmailNotify) {
    print "   " .
           $q->checkbox(-name=> 'do_email_notify',
      -label=>Ts('Send email notification that %s has been changed.', $id));
  }
  print "<br>";
  if ($EditNote ne '') {
    print T($EditNote) . '<br>';  # Allow translation
  }
  print "<br>";
  $userName = &GetParam("username", "");
  if ($userName ne "") {
    print T('Your user name is'), ' ',
          &GetPageLink($userName), '.';
  } else {
    print Ts('Visit %s to set a user name ', &GetPrefsLink()), Ts('or %s with a\n existing one.', &GetLoginLink()); ## Login link provided
  }

  if ($isConflict) {
    print "\n<br><hr><p><strong>", T('This is the text you submitted:'),
          "</strong><p>",
          &GetTextArea('newtext', $newText, $editRows, $editCols),
          "<p>\n";
  }
  print "<hr>\n";
  print "<b>", &GetPageLink($TFRules), "</b><br>";
  print "<b>Emphasis:</b> ''italic'', '''bold''', '''''both''''', :indented text, ::even more indented<br>";
  print '<b>Lists:</b> * for bullet lists, # for numbered lists; ";term:definition" for definition lists, #foo# for counters<br>';
  print "<b>Tables:</b> ||1a||1b|| next line: ||||2a&b||<br>";
  print "<b>Internal links:</b> JoinCapitalizedWords or use double square brackets for a [[free link]]<br>";
  print "<b>External links:</b> Plain http://cool.wiki.int/ or in square brackets [http://cool.wiki.int/] for numbered links<br>";
  print "<b>Name links:</b> [WikiLink name], [[free link|free name]], [http://cool.wiki.int/ name]<br>";
  print "<b>Misc:</b> = heading1 =, == heading2 ==, \\ linebreak, ---- horizontal rule (the more dashes the thicker)<br>";
  print "<hr>\n";
  ## Patch end :-)
  if ($preview) {
...

These are the basic rules for my patched wiki. Possibly you want to exclude the counters, the tables and the linebreak. Possibly even the named links if disabled in your wiki. --DavidAndel

What, no screenshot? ;-) -- MatthewSimpson

[Here] you go :-)
The screenshot is not exactly the same as you'll get from the patch, since in that other wiki WikiWords and some other minor stuff are turned off. -- DavidAndel


Here is a link for what cwick did for adding formatting rules at the bottom. I think this is quiet important.

http://cwick.sourceforge.net/cgi-bin/cwick.pl?action=edit&id=FeatureRequestPage

I will be doing a mod like this as well. Check my todo list on my page --MarkButler


UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited May 22, 2009 4:33 pm by GunnarH (diff)
Search: