[pmwiki-users] Fox : target and ptvtarget (form)

ABClf languefrancaise at gmail.com
Sat Apr 10 10:47:35 CDT 2010

Thanks for your reply Hans (ok, I'm a bit late ;)).
At this time, I get a basic working form ; I can use it to post hidden
ptv to targetpage.
Then, in every created page, I also include a template to show hidden
ptv in a convenient way (layout/content). This way, I can easily alter
the look of all pages.

Here it is a light version of my post form, say Info/Post ; it does
create Info/YYYY-MM-DD-my-title page.

(:fox form_info ptvtarget={$$cible}:)
'''url :''' (:input text cible size=80 value="{$Today}-":)
'''titre :''' (:input text $:titre_info size=80:)
'''résumé :''' (:input textarea $:resume_info cols=80 rows=3:)
(:input submit post Poster:) (:input submit cancel $[Cancel]:)
(:foxend form_info:)

I have two more questions for anyone using fox :
1/ how to get a working preview ? I tried different ways with no
success : every time, the informations are posted and the new page is
created, not previewed. I don't know whether I need a template (and
what would be its content) or not, and I don't know where to write
commands in my form ;
2/ how to make in sort that editing a page created with this form
automatically use this form instead of the usual edit pages (ptv
update ?).


2010/3/22 Hans <design5 at softflow.co.uk>:
> Monday, March 22, 2010, 4:26:37 AM, ABClf wrote:
>> Here it is my question :
>> when using this code, I can create the new target page :
>> (:fox forminfo put=top template=Info.Maquette target={$$cible}
>> keepinput=1 formcheck=titreinfo pagecheck=1:)
>> But using this one, I'm not allowed to post to any new target page :
>> (:fox forminfo put=top template=Info.Maquette ptvtarget={$$cible}
>> keepinput=1 formcheck=titreinfo pagecheck=1:)
>> As you can see, I changed target to ptvtarget.
>> Can you explicit what's wrong ?
> If you want to add PTVs and/or modify PTVs use ptvtarget=
> But if you also use template=, Fox expects also target=.
> so don't use template= and also don't use put=top, the last is not
> needed as no content is added, and instead a different process to add
> and update PTVs is used.
> So this should be the correct form snippet:
> (:fox forminfo ptvtarget={$$cible} keepinput=1 formcheck=titreinfo pagecheck=1:)
> If you want add content and update/add PTVs, you should use target=
> and template= an d put= parameters for adding content, and either use
> ptvtarget= as well, or use ptvupdate=1. The last one will use as
> ptvtarget what is set with target=
> Hope this makes it clearer. There are still some other ways of setting
> target pages and ptv target pages, especially if more than one page
> is set as target, but the above is the simplest.
>  ~Hans

| A | de la langue française
| B | http://www.languefrancaise.net/
| C | languefrancaise at gmail.com

More information about the pmwiki-users mailing list