[pmwiki-users] Repost: Could Edit always include Preview?

Patrick R. Michaud pmichaud at pobox.com
Fri Apr 28 14:24:46 CDT 2006


On Fri, Apr 28, 2006 at 08:15:02PM +0100, Hans wrote:
> Friday, April 28, 2006, 7:32:29 PM, Patrick wrote:
> > Even better, shorter, and more robust is the following:
> 
> >     !!$[Preview {$FullName}]]
> >     (:if e_preview:)'''$[Page is unsaved]'''(:if:)
> >     (:e_preview:)
> >     (:if e_preview:)
> >     ---
> >     '''$[End of preview -- remember to save]'''
> >     (:if:)
> >     [[#top | $[Top] ]]
> 
> > Notably, this version doesn't require the use of (:include:),
> > nor does it result in the repeating include when the EditForm
> > is being edited.
> 
> This does nothing for me. After small syntax correction:
> 
> !!$[Preview {$FullName}]
> (:if e_preview:)'''$[Page is unsaved]'''(:if:)
> (:e_preview:)
> (:if e_preview:)
> ----
> '''$[End of preview -- remember to save]'''
> (:if:)
> [[#top | $[Top] ]]
> 
> it still does nothing. Anything missing?
> Why (:if e_preview:) twice?
> What replaces the page include I proposed?

Oops, you're right.  I thought (:e_preview:) would
always display a preview, but apparently it looks for
$_POST['preview'] being set.  For now, add the following
to config.php:

    if ($action == 'edit') $_POST['preview'] = 1;

Pm





More information about the pmwiki-users mailing list