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

Tegan Dowling tmdowling at gmail.com
Fri Apr 28 12:22:57 CDT 2006


On 4/28/06, Hans <design at softflow.co.uk> wrote:
> you could add at the bottom of your Site.EditForm or whatever edit
> form you use:
>
> (:if ! e_preview:)
> ----
> !{$Title}
> (:include {$FullName}:)
>
> Don't get frightened when you save the edit form, because it will
> include itself a number of times. It works fine on other pages,
> the page is displayed "as is" underneath the normal edit form,
> separate it with a horizontal rule and title header if you like.
> When previewing your edit this will not display, but the preview
> instead.
>
>
> Best,
>  Hans

Ah!  Sure!  Until someone edits a page, the 'preview' is just the page
itself. Nice!

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] ]]

Because someone could well have made changes and then looked at the
bottom of the page without either clicking "Save and Edit" OR
"Preview", so it's a reasonable safety measure to remind people that
they're in edit mode.  Perfect -  Thanks, Hans!




More information about the pmwiki-users mailing list