[pmwiki-users] best way to change editform per view?

Bronwyn Boltwood arndis at gmail.com
Fri Aug 19 12:45:52 CDT 2005


On 8/18/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > On 8/18/05, Bronwyn Boltwood <arndis at gmail.com> wrote:
> > > Another thing that I really want is that when I hit preview on the
> > > editform, PmWiki will jump to the preview section for me.  How can I
> > > arrange that?
> 
> The basic problem is that the preview button has to be a submit button
> for the edit form, and the url that the browser goes to is in the
> <form> element (which would therefore have to have the #preview
> anchor at the time the preview button is pressed).  Unfortunately,
> we don't always want the browser to jump to a preview section
> whenever the form is submitted;  save+edit and simultaneous
> edit conflicts should probably not jump to the preview.
> 
> So, we need some trickery here.  I have three ideas:

I rather like #1 and maybe #3, but not #2, since I'd rather not
require Javascript.

Maybe I should go with Dominique's technique of putting the preview
section on top, with internal links to jump around.  That would make
it clear that hitting preview did something, allow editors to save
easily, and not cause any coding hassles.

To change the editform by view, I'm going to try the method outlined
at http://www.pmwiki.org/wiki/Cookbook/SkinGuidelines, but use

'Site.EditForm' => "Site.LensEditForm-$View",

That should work, right?

> > > I'd like to always show the GUI edit buttons in the standard view
> > > editform, but allow the admin's decision in config.php to take over
> > > for author and admin views.

I wonder if I could do this in one of the skin's php files with something like

if ($View = 'standard') $EnableGUIButtons = 1;

Hmm....

Bronwyn




More information about the pmwiki-users mailing list