[pmwiki-users] Workaround for fox form redirection problem

Hans design5 at softflow.co.uk
Sun Apr 13 07:47:41 CDT 2008


Sunday, April 13, 2008, 3:10:14 AM, Randy wrote:

> 2) Then I tried installing the latest version of Foxedit as well, to  
> see if that would fix the problem. That caused my form to simply  
> return me to the target page when invalid input is submitted. No error
> message or chance to correct.

Note this is a redirection to the target page (the calling page).
You will see error messages if the page contains a
(:foxmessages:) directive. The (:foxmessages:) directive on the edit
form does not help, as we redirect away from the form.

> 3) I then tried using Foxedit to edit an anchored section (using code
> that had previously worked). My old code didn't work now.

The new FoxEdit has a few changes, and one is that an anchored section
will not be treated automatically as a PTV. The default edit form for
an anchored section is the EditSectionForm.

Maybe this is  shortcoming I still need to address.

> 4) So I modified the code to make the form explicit:

> {[foxedit #to_do_current 'Edit current' form=Edit.EditMessageForm]}

> The above still brings up the EditSectionForm - not the form that I  
> specified.

{[foxedit #section .... ]} will use the default section edit form
(EditSectionForm) or you need to specify a different section edit
form. Study the differences between EditSectionForm and EditPTVForm,
so you knowe what a custom section edit form requires.

But if you use
{[foxedit section ...]} it will use the default ptv edit form, by
recognising the anchored section as a PTV (as was the case with
previous FoxEdit). Note the missing #. This is a change from previous
FoxEdit. So the # marks an anchored section and will use a section
edit form, or need to use a section edit form, and dropping the #
will mark it as a PTV and use the PTV edit form, i.e. the anchjored
section

[[#section]]
...
...
[[#sectionend]]

will be treated as a PTV.

Note that there is a third option, where you specify a foxedit markup
which does not relate to any section or PTV, by using just any name
and a custom form, like

{[foxedit special 'edit special' form=SpecialEditForm]}

and your SpecialEditForm will load any PTVs you want to be edited,
not just one named PTV, by using the appropiate input fields.
It has to be a PTV edit form though.

The section edit form will only work on a page section, not several,
and not a section and other PTVs. Although the section can be longer
than just one section, by specifying a beginning and an ending anchor:
{(foxedit  #abc..#xyz )}

I am sorry if all this sounds a bit confusing: Having two rather
different methods to edit a part of a page: re as PTV or as section!
Generally it is properly best to stick to PTv edit forms, and drop the
# to refer to anchored sections as PTVs.


  ~Hans




More information about the pmwiki-users mailing list