[pmwiki-users] RE: Page Edit Ideas

Patrick R. Michaud pmichaud at pobox.com
Mon Jan 31 10:06:08 CST 2005


On Mon, Jan 31, 2005 at 09:37:50AM -0600, Ben Wilson wrote:
> 
> I would think a separate template specifically for the edit portion of the page
> would be idea. That is, while you have skin.tmpl to represent the entire page,
> then you would want skin-edit.tmpl for the edit interface. This means that
> skin-edit.tmpl would replace $PageEditFmt.

The problem may be that an HTML template is just too 
"simple" for many of the customizations that need to be 
performed.  For example, the skin.tmpl files have a
<!--HeaderText--> section which provides hooks for
cookbook recipes to insert custom styles and other
HTML tags that need to appear in the <head> section of
the document.  It also has predefined <!--PageHeaderFmt-->,
<!--PageTitleFmt-->, etc., sections so that skin designers
can design skins compatible with the (:noheader:), 
(:notitle:), (:nofooter:), etc. markups.

The question here is one of knowing what similar
"hooks" need to be placed in $PageEditFmt that
cookbook script authors can hang their customizations
on.

For example, let's consider the recent addition of
the GUI edit buttons to PmWiki, and suppose there
are a lot of pre-existing custom edit templates 
(skin-edit.tmpl files) on sites around the world.

Now then, when PmWiki adds GUI buttons, it needs to be able
to know where in the edit page to place the buttons.
However, if the existing skin-edit.tmpl template files 
don't already have an appropriate "hook" in them on 
which to hang the GUI edit buttons, then the GUI buttons 
won't appear until those files are updated somehow.

(In reality what I did to make this work for the current
distribution is to hang the GUI buttons off of the existing
$EditMessageFmt variable hook, which is not a very good way to
have done this, because in a custom edit page template
it would cause the buttons to be displayed with the edit
messages and not necessarily with the textarea box.  And
at present there aren't any "hooks" that allow you to
easily add new buttons or fields at the bottom of the
textarea.)

Most people, including cookbook authors and site administrators,
would like these things to be something they can just "turn on"
by including the appropriate recipe or switch setting, rather 
than having to edit every template file that is being used.
In order to do that we have to come up with standard
places where additional features can be "hooked" into the
edit form.

> I think
> this would also reduce the need of various cookbook items to muddle with
> $PageEditFmt, which leads invariably to recipe crash. 

No, without predefined hooks it would just mean that cookbook items 
would then have to muddle with the template, with the same amount of
recipe crash.

It's also worth pointing out that $PageEditFmt can *already* be
set from within a template file, by defining a <!--PageEditFmt-->
section in the .tmpl file.  But AFAICT this doesn't really resolve
the overall difficulties.

Pm



More information about the pmwiki-users mailing list