cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
You are here: Foswiki>Tasks Web>Item6039 (09 Nov 2010, MichaelDaum)Edit Attach

Item6039: Preview does not respect VIEW_TEMPLATE

pencil
Priority: Urgent
Current State: Closed
Released In: 1.0.0
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: MichaelDaum
Waiting For:
Last Change By: MichaelDaum
Don't show the "uggly truth" in preview mode. Instead, wrap the data into the same VIEW_TEMPLATE that the user normally sees. The bug in itself is not sever, only uggly. But as it is a fundamental flaw, I make it urgent to get it fixed soon.

But how do we mix in the normal preview gear into the VIEW_TEMPLATE? Do we need a PREVIEW_TEMPLATE variable?

Dynamically rendering a preview similar to view (e.g. using SEARCH, FORMFIELD, etc) is a problem in itself because it does its calculations on the base of the data already committed to the store. However, the preview holds the new data in a hidden form which is not committed yet and thus is not accessible to the TWikiApplication inside a preview. Here it is your pandora's box.

This is not fully solvable other than ripping out the preview button, afaics.

-- MichaelDaum - 01 Oct 2008

I'd rather that Preview used VIEW_TEMPLATE - otherwise there's a good chance of things getting out of sync, and the users not seeing it fo what they mean.

-- SvenDowideit - 05 Oct 2008

i just faced this question with the PublishPlugin. i decided in the end to honour VIEW_TEMPLATE rather than try and support PUBLISH_TEMPLATE, because users will reasonably expect it to do what it says on the tin. i think the same applies here.

Done

ItemTemplate edit

Summary Preview does not respect VIEW_TEMPLATE
ReportedBy MichaelDaum
Codebase trunk
SVN Range TWiki-5.0.0, Tue, 23 Sep 2008, build 17539
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins Rev 414 not found distro:0496185fe4d6
TargetRelease patch
ReleasedIn 1.0.0
Topic revision: r10 - 09 Nov 2010, MichaelDaum - This page was cached on 22 Mar 2018 - 23:23.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License