[pmwiki-users] Bug with SetTmplDisplay in preview handling?

Patrick R. Michaud pmichaud at pobox.com
Mon Mar 7 09:18:08 CST 2005


On Mon, Mar 07, 2005 at 02:53:51PM +0000, Hans wrote:
> Monday, March 7, 2005, 2:09:49 PM, Patrick wrote:
> > So, it's not really a bug, although it could be a design misfeature.
> > I'm open for suggestions on changing this, although I don't have any
> > at the moment.
> 
> okay I understand now that it is not a bug, but preview just doing its
> job of rendering the page, including the (:showright:) markup in the
> page. So what would be nice to be able to influence the preview
> behavior, like having a condition "if preview do this and ignore
> that".

How about just not processing the markup if $action == 'edit'?

    if ($action != 'edit') {
      Markup('showright','directives','/\\(:showright:\\)/e',
        "SetTmplDisplay('PageRightFmt', 1)");
    }

Thus, a preview won't process (:showright:) but will leave it
displayed in the preview, so that an author can see that the
(:showright:) is there.

Or something like that.

Pm



More information about the pmwiki-users mailing list