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

Patrick R. Michaud pmichaud at pobox.com
Fri Apr 28 13:32:29 CDT 2006


On Fri, Apr 28, 2006 at 12:22:57PM -0500, Tegan Dowling wrote:
> On 4/28/06, Hans <design at softflow.co.uk> wrote:
> Just to get the full picture: I actually replaced this
> 
> (:e_preview:)
> ----
> '''$[End of preview -- remember to save]'''\\
> [[#top | $[Top] ]]
> (:if:)
> 
> with this
> 
> (:e_preview:)
> ----
> '''$[End of preview -- remember to save]'''\\
> (:if ! e_preview:)
> ----
> !!$[Preview `{$FullName}]
> (:include {$FullName}:)
> ----
> '''$[End of preview -- remember to save]'''\\
> (:if:)
> [[#top | $[Top] ]]

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.

Pm




More information about the pmwiki-users mailing list