Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

PreviewTop

Summary: How to place the page preview above the edit box
Version: Jun-06-2004
Prerequisites:
Status:
Maintainer: Pm
Categories: Layout

Question

By default, PmWiki's edit form places the page preview beneath the edit box. How can I move it to be at the top instead?

Answer

This recipe is superceded by 2.0.beta44. Now to adjust the position of the page preview, edit the Site.EditForm page on your site. --Pm

Add the following code to a local customization file:

    $HandleEditFmt = array(&$PageStartFmt,
      &$PagePreviewFmt,&$PageEditFmt,&$PageEndFmt);

Discussion

This statement simply switches the order of the $PagePreviewFmt and $PageEditFmt variables from their default, to cause the page preview to appear first. This Cookbook page has this customization set, thus while editing this page any edit preview will appear at the top instead of the bottom (see PreviewTop?action=edit&preview=y).


If you want to display the edit quick reference as well, use

    $HandleEditFmt = array(&$PageStartFmt,
      &$PagePreviewFmt, &$PageEditFmt,'wiki:PmWiki.EditQuickReference',
      &$PageEndFmt);

instead of the above code.

--thom

Idea for alternative behaviour

What if pressing the 'Preview'-button would leave the resulting edit-window scrolled to the top of the previewd part? (Rather than seeing the code). /Christian

I don't know how to do this in HTML, sorry. --Pm
Couldn't this be done by putting a named anchor at the top of the preview section? fick?

Contributors

  • Pm, Jun-06-2004

This seems to be broken or perhaps the customization is not set anymore? -- Balu

Fixed now -- I apparently deleted the customization at some point in the past. --Pm

Looks like you did again :) Balu

Fixed again :) --Pm

Edit - History - Print - Recent Changes - Search
Page last modified on March 23, 2007, at 06:01 PM