[pmwiki-users] FoxEdit & new sections

Hans design5 at softflow.co.uk
Thu May 14 07:23:02 CDT 2009

Thursday, May 14, 2009, 1:33:42 AM, adam overton wrote:

> ahh
> noticed one error on the FoxEdit-Talk page.
> in the working examples towards mid-page, the EditSectionForm example:
> (:fox editform foxaction=replace put=overwrite target={$EditTarget} 
> {$EditSection} redirect={$EditTarget}{$EditSection}:)

> should instead be:
> (:fox editform foxaction=replace put=overwrite target={$EditTarget}# 
> {$EditSection} redirect={$EditTarget}#{$EditSection}:)

> and in FoxEdit, commenting out the following line causes everything  
> to work, and the section is added:
>         //if ($fts['pos']==0) FoxAbort($pagename,"$[Error: cannot find
> section] '$section'");

> is there a different check that should be made here, instead of  
> commenting it out?

I think you are right that the EditSectionForm is missing
a # between {EditTarget} and {EditSection}. That is a bug
needing correction.

But you should not use it anyway as you want to create a new anchor
section as a PTV! I think I will regret forever for having introduced
two totally different type of forms for editing PTVs and for anchor
sections, as it will continue to confuse people.

FoxEdit uses two different ways to call the two different default
edit forms:
For PTVs use the name of the PTV in the markup, like
{[foxedit abc]} to edit PTV 'abc'.
For anchor sections use the anchor name including the # hash
character, like {[foxedit #xyz]} to edit section
But if the abchor section is treated as a  PTV, then
use {[foxedit xyz]} to call the PTV edit form.
And to create new PTVs as anchor sections you need to add
ptvfmt=section to the (:fox .... :) markup of the EditPTVForm
(or the relevant custom form if that is what you use).
This also means you do not ned to comment out anything in foxedit.php

If you use markup like {[foxedit #xyz]}, and no [[#xyz]] section is
found, Foxedit aborts with an error message. There is no possibility
to create such a section from the EditSectionForm. This is only
possible if the section is treated as a PTV, and called as a PTV
(without the # hash), and "ptvfmt=section" is added to the form in
the (:fox... markup.

I hope that makes it clearer!


More information about the pmwiki-users mailing list