[pmwiki-users] FoxEdit & new sections

adam overton a at plus1plus1plus.org
Thu May 14 14:31:50 CDT 2009


ok, i get it.
i was thinking of PTV's as simply *a thing* on the page, whereas  
you're thinking of it as an idea - that can include the use of  
anchored sections. but - it is a little confusing, so i recommend  
documenting well...

so, it now works without editing the FoxEdit code. here's what i did:
1.
i created a new EditForm for editing sections as if they were PTV's,  
and I named it EditSectionAsPTVForm - it is exactly the same as the  
FoxTemplates/EditPTVForm, except for the addition of ptvfmt=section:
    (:fox editform ptvtarget={$EditTarget} ptvfields={$EditSection}  
ptvfmt=section redirect=1:)

2.
i then changed my FoxEdit link so that it calls this new form (no #  
in front of the section)
{[foxedit myTestSection label="edit testSection2"  
form=FoxTemplates.EditSectionAsPTVForm]}


that all seems to do the trick. thank you so much for explaining...

now i wonder one last thing. once i've created a section this way and  
go back to edit it again, as a section, is there any benefit to using  
the EditSectionForm? it seems using the EditSectionAsPTVForm does  
this just fine. i guess i'm not sure what difference there really is  
now between these two forms, other than that probably access two  
different components of Fox code to do the same thing, right?

thanks again for the help,
adam





On 14 May 2009, at 5:23 AM, Hans wrote:

> 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
> [[#xyz]]....[[#xyzend]].
> 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!
>
>
>   ~Hans
>




More information about the pmwiki-users mailing list