[pmwiki-users] PTV and Page Directive through Fox

Hans design5 at softflow.co.uk
Sun Mar 23 04:05:55 CDT 2008


Sunday, March 23, 2008, 3:40:55 AM, Sameer Kumar wrote:

> (:fox featform:)
> (:foxptv {*$FullName} ptvfields=featured:)
> (:input textarea desc rows=4 cols=80:)
> (:input hidden featured '{$$(ftime)}':)
> (:input submit post 'Mark as Featured':)
> (:foxtemplate "(:description {$$desc[]}:)":)
> (:foxend featform:)

> I can get the PTV just fine but the page directive does not get
> inserted. I wonder if the (: and :) in the template are problemmatic...
> Or, is it the fact that I am trying two different fox actions:
> foxptv and foxadd through the same form?
> Can a page directive be inserted with fox at all?

I do not see any 'and' in the foxtemplate string.
But it would not be possible to use a logical AND in the middle of a
template string (and I don't see the sense in it anyway).

You can post directives, if that is enabled with
   $EnablePostDirectives = true;

I thought it does not work to insert multi-line text into the
(:description ...:) markup, so your use of (:input textarea ...:)
is problematic.

You can add content and update PTVs with the same Fox form.
If a ptvtarget is specified, Fox will always try to update PTVs,
never mind which other fox action is set.
But by using (:foxptv ...:) there is no default foxaction=add set any
more. So you need to change your form to something like this:

(:fox featform ptvtarget={*$FullName} ptvfields=featured :)
(:input hidden featured '{$$(ftime)}':)
(:input text desc :)
(:input submit post 'Mark as Featured':)
(:foxtemplate "(:description {$$desc[]}:)":)
(:foxend featform:)

foxaction=add is implied, as the default. The current page is implied
as target, because of the presence of (:foxtemplate ...:)
If the form is included somewhee else, better write

(:fox featform target={*$FullName} ptvupdate=1 ptvfields=featured :)
(:input hidden featured '{$$(ftime)}':)
(:input text desc :)
(:input submit post 'Mark as Featured':)
(:foxtemplate "(:description {$$desc[]}:)":)
(:foxend featform:)

Here ptvupdate=1 is justused as a shortcut to avoid using
ptvtarget={*$FullName} as well as target=....

Hope this makes sense.


  ~Hans




More information about the pmwiki-users mailing list