On Nov 13, 2007 7:42 PM, Hans &lt;<a href="mailto:design5@softflow.co.uk">design5@softflow.co.uk</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Tuesday, November 13, 2007, 11:43:12 PM, DaveG wrote:<br><br>&gt; How do you handle retrieving the wiki-text (ie the text to put in the<br>&gt; textarea for editing), and saving it back and getting the page text (ie,
<br>&gt; the text to display on the web-page)?<br><br></div>The primary approach is now to use page text variables, and adding the<br>[[#NAME]] ... [#NAMEend]] syntax as a PTV pattern, so anchored<br>sections can be retrieved as PTVs. (To find a solution like this was the
<br>purpose of this list thread). The retrieval works well with the<br>(:input defaults source=PageName:), as Pm suggested in this thread.<br><br>Saving the changes is done via the PTV update function in Fox.<br>The PTV fields named in the edit form will be updated and the page
<br>saved with the updated text.<br></blockquote><div><br>This is a brilliant approach, Hans. I would have never dreamed of using PTV&#39;s to make editable anchor sections. Kudos...&nbsp; It has me considering all sorts of possibilities.
<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I still have not given up on a second approach, which can retrieve<br>page sections (anchor marked sections) by passing the pagename with
<br>the section marker(s) to the TextSection function, which returns the<br>section, or the whole page, according to the anchors passed. This is<br>used to set a InputValues[&#39;text&#39;] variable, with the effect that it
<br>appears inside the edit textarea control named &#39;text&#39;, for editing.<br><br>In this case saving is not done via PTV update, but I use a new<br>text &#39;replace&#39; routine for this: instead of inserting text content at
<br>the bottom it replaces all. The trick is that it can act on the section,<br>so the rest of the page text is unaffected. Giving a pagename as<br>target, the &#39;replace&#39; will replace all of the page text with the new
<br>text from textarea. Giving a pagename with anchor will only replace<br>the section from anchor to next anchor. Or from anchor to another<br>anchor given. In a way it is similar than retrieving template<br>sections, only turned around to replace target sections.
<br></blockquote><div>&nbsp;<br></div><div>ZAP has been doing exactly this for a long time. Where the target is a page, it edits the entire page, where the target is an anchor, it edits the corresponding section. The code is fairly trivial, as long as there is forms processor capable of managing it. Feel free to take a look if you wish. Its around line 154 in the ZAP toolbox.
<br><br>I&#39;m curious though why you prefer this solution vs using PTV&#39;s which are so well supported in the core?<br>&nbsp;</div></div>Cheers,<br>Dan<br>