[pmwiki-users] Tweak to saving a page

Hans design5 at softflow.co.uk
Fri Feb 13 12:26:41 CST 2009


Friday, February 13, 2009, 5:30:50 PM, Peter Lutz wrote:

> 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.

Yes. But  not as normal action=edit. Your form can have  a textarea
box for authors to enter the content.

(:foxmessage:)
(:fox newpage template=Test2.NewPageTemplate redirect=1:)
(:input hidden target '{$$(serialname Test2)}' :)
(:input texarea text cols=80 rows=12:)
(:input submit post "Create New Entry":)
(:input submit cancel "Cancel":)
(:foxend newpage:)

The template page should have somewhere {$$text} as a placeholder
where the posted value of the text box goes.
I don't know your template, so it is hard to suggest.
You could have more input fields, some (:input text name:) fields fro
instance, for structuring the input, and direct it via the template
to the target page.

So instead of users clicking  a button, which opens a new page ready
for filling with content (via action=edit), users fill in new content
in a form, and clicking the button will create it, with correct
serial name.

Redirect will take you to the new page, to view the new page with the
new content.

BTW (:foxmessage:) is great for feedback, but it is useless with
a redirect=1 in the form. Still, with  a(:foxmessage:) markup, disabling
the redirect will be good for trouble shooting.


  ~Hans




More information about the pmwiki-users mailing list