[pmwiki-users] fox: custom ptvfmt

noskule noskule at gmx.net
Mon Mar 3 08:28:03 CST 2008

Hans schrieb:
> Monday, March 3, 2008, 12:07:14 PM, noskule wrote:
>> hm, I work on this, but fox uses just the standard ptvfmt. It seams not
>> to look for templates, do you see the problem?
>> (:foxptv {$?editgroup}.{$$Title} ptvfields=Text 
>> template=PageFormTemplates.HiddenSection:)
>> (:input textarea Text cols=60 rows=6:)
>> PageFormTemplates.HiddenSection - - - - - - - - - - - - - - - - - - - -
>> - - - - - - - - -
>> [[#!Text]]
>> {$$Text}
>> [[#!Textend]]
> Yes. Fox does not look for ptv-templates when adding new PTVs
> automatically if they don't exist on the target page and are named by
> the ptvfields= parameter. Fox uses ptvfmt= instead if specified, but
> this is hard coded. Can we sof code this as a ptvtemplate? Not sure
> if this is possible or desirable. Perhaps desirable, but worth the
> effort?
Ok first, I found out the problem above can be solved easy be adding a 
template by the "new page" form and none be the edit form. So below some 

I don't no fox so well jet but it seams customization should be possible 
in one way or the other cause the statement below seams to check only 
if  value is empty but not if the ptv exists. So with foxadd the ptv 
would be posted a second time. This could happen if a user submit an 
empty field.

In the other hand, how many versions of ptvfmt are needed. Threre are 
probably two, visible and invbisible ones. The other criteria are about 
(accidently) "unbreakable" and that's the section version. So IMO it 
could make sense to add a hidden section ptvfmt in fox.

One more thing is that hidden section makes it possible to separate 
layout from content and change the layout on the fly for all pages.

> You could add a PTV of custom format using foxadd conditionally:
> (:if equal {TargetPage?:Text} '':)
> (:foxadd target=TargetPage template=PageFormTemplates.HiddenSection:)
> (:ifend:)
>   ~Hans

More information about the pmwiki-users mailing list