[pmwiki-users] Tweak to saving a page

Peter Lutz dreiaugen at gmx.de
Fri Feb 13 11:30:50 CST 2009


Am Fri, 13 Feb 2009 12:40:54 +0000
schrieb Hans <design5 at softflow.co.uk>:
> 
> I would use Cookbook:Fox and create a custom new page form.
> You can set it up with whatever input fields you wish, not just a
> textarea field. You set up  a template which determines how the
> submitted content shall appear in the target page. And you set up the
> target page using the serialname markup expression as you do for you
> present NewPage form, but with this twist:
> 
> (:input hidden target {$$(serialname ..........)} :)
> 
> The two $$ signs make Fox evaluate the expression on page submission,
> and not when a user opens the form page. So your ne wpage names will
> automatically be in serial, no conflict if a user drops out of
> creating a new page.
> 

It's a not yet. I came to the following form:

(:foxmessage:)
(:fox newentry template=Test2.EditForm redirect=1:)
(:input hidden target '{$$(serialname Test2)}' :)
(:input submit post "Create New Entry":)
(:foxend newentry:)

Which makes the new entry. Another user will make the next entry. This is not really the kind of conflict management I wanted, but there is this another problem: It already made the entry!! It makes them and views them. I need to start it as an edit. 

And, if possible, if you cancel the edit, or go back with the browser, the page never existed. Thinking about this made me come to the conclusion I'll need some fox (?) in the template too. When users are editing the same page (serialname gives the same serial number if the page not exists yet) there must be something on that page to ensure they save with different names? 

I tried adding (:input hidden action edit:) in the above form, but then it ceased working at all.

Is it important what's on the template? (it's all markup from dataquery and the page is only functional in edit mode)



More information about the pmwiki-users mailing list