[pmwiki-users] Tweak to saving a page

Peter Lutz dreiaugen at gmx.de
Fri Feb 13 13:27:59 CST 2009

Am Fri, 13 Feb 2009 18:26:41 +0000
schrieb Hans <design5 at softflow.co.uk>:
> 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.

My template is a zap-form created by DataQuery. The page than fills a mySQL database with its content and later it gonna have a lot more variables.

(:title Editing {*$Group} {*$Name}:)
(:zapform key=edit:)
(:table class=DQedit:)

(:cellnr class=head:)%class=required%Titel:
(:cell:)(:input text Titel '{*$:Titel}' :)

(:cellnr class=head:)%class=required%Text:
(:cell:)(:textarea name=Text rows=5 cols=60:)(:keep {*$:Text}:)(:textareaend:)

(:cellnr class=head:)%class=required%Autor:
(:cell:)(:input text Autor '{*$:Autor}' :)

(:zap savedata="ID,Titel,Text,Autor" edit:)
%center%(:input submit post ' Save ':)
(:zapform key=del:)(:input submit name=DelButton value=Delete:)
(:zap if1="equal {DelButton} Delete ? delete=^" del:)
(:zap delete="" del:)

> 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.
That's it, exactly!

So your suggestion would mean to transform the zap code on the template site into fox code at the button, and prepopulate the template with variables, right?


More information about the pmwiki-users mailing list