[Zope] Changing contents of a file

Martin Dougiamas martin@complex.curtin.edu.au
Sun, 2 May 1999 11:42:13 +0800 (WST)


I'm following up my own message, for the benefit of the archives,
with a good working solution I received from Ben Chapman, included below.

Martin Dougiamas wrote:
> 
> What I want to do is to replace the contents of a HTML file with 
> the contents of a variable I have, using DTML, in a similar
> way to that way the Zope manager Edit tab does it.  Seems simple 
> enough, but every combination I try seems to fail.


Ben's solution is included below:

> Date: Wed, 28 Apr 1999 00:36:01 -0500
> From: Ben Chapman <bchapman@utulsa.edu>
> Organization: University of Tulsa College of Law
> To: martin@dougiamas.com
> 
> Martin:
> 
> In response to your question about updating a document based on the
> content of a form variable, this seems to work for me:
> 
> I have a document called "intro" that contains text.
> 
> I have a document called "intro_update" that contains this:
> 
>   <form action="process_update" METHOD="POST">
>   <textarea wrap="off" name="data:text" rows="20" cols="50">
>   <!--#var intro-->
>   </textarea><BR>
>   <input name="Submit" type="Submit"><input name="Reset" type="Reset">
>   </form>
> 
> "process_update" looks like this:
> 
>   <!--#var standard_html_header-->
>   <!--#if data-->
>       <!--#call "intro.manage_edit(_.getitem('data'),'')"-->
>       <P>Your document was successfully updated.
>   <!--#else-->
>       No data entered!<BR>
>   <!--#/if-->
>   <!--#var standard_html_footer-->
>


And this works great for me, too.  :-)   Thanks, Ben.

Cheers,
Martin 
--
### Martin Dougiamas -- Internet Agent          is == i see
### Centre for Educational Advancement
### http://cea.curtin.edu/staff/martin