|
Cookbook /
FoxEdit-TalkQ: Hans, could you maybe include a working example for this recipe? A functional example, which I could just copy and paste onto my site, that would be really helpful for me. I don't know if it's that I'm missing something, or if there is some information missing from the recipe page, but I just cannot make this work. Did you look at FoxContacts? There is a link to a live example on my site. All form pages are in the same group, click the "List Group" button in the footer. And the "source" button can show you the code I used. FoxForum also uses foxedit links. For a very simple example you can take a look here: Thanks very much, Hans - the WikiSandbox2 example on your site cleared up my confusion. I noticed that even though I have $EnablePostDirectives set to "false" in Fox.php, one can still post directives when editing a section. Is there currently any setting I can change to prevent that? - Phil Thanks! I updated fox.phpΔ so the FoxPTVUpdate function will now also prevent directive posting if $EnablePostDirectives = false. HansB January 12, 2008, at 04:14 AM Excuse me, but where can I see simple code/source for a working examples of FoxEdit and FoxDelete? Especially I'd like to see it in templates/forms for Fox... Is it possible somewhere? at present it is implemeted in FoxForum and FoxContacts, both perhaps rather complex examples, as both use display templates as well as form templates. Here is a basic foxedit example, in wiki source code, to edit a page text variable. The link will call the default Fox form to edit PTVs, which is FoxTemplates.EditPTVForm (source code on FoxEdit page): VarA: some value
{[foxedit VarA 'edit VarA']}
The next example will open a page section in the default edit form FoxTemplates.EditSectionForm (source code on FoxEdit:
{[foxedit #section1 ]}
[[#section1]]
text in section1
more text...
[[#section1end]]
The next example will open three PTVs to be edited with a custom Fox form added to Site.FoxTemplates section #customform:
{[foxedit form=Site.FoxTemplates#customform]}\\
(:ptvA: abcdefg:) {$:ptvA}\\
(:ptvB: defghi:) {$:ptvB}\\
(:ptvC: 123456:) {$:ptvC}\\
and the custom form template:
[[#customform]]
(:fox frm ptvtarget={$EditTarget} redirect=1:)
(:input defaults source={$EditSource} :)
'''Editing {$EditTarget}:'''
||
|| ptvA||(:input text name=$:ptvA :) ||
|| ptvB||(:input text name=$:ptvB :) ||
|| ptvC||(:input text name=$:ptvC :) ||
|| ||(:input submit post Save:) ||
(:foxend frm:)
[[#customformend]]
Note that FoxEdit defines page variables Perhaps all this should be on the FoxEdit page. For FoxDelete links I will try to add some examples there. HansB April 03, 2008, at 12:51 PM Thank you for explanations! |