Date:  05/29/2015 05:56:13 PM Msg ID:  004808
From:  FoxWeb Support Thread:  004805
Subject:  Re: Web page to edit an HTML file
You were quite clear. I was simply responding to your question, which was whether you need one or two fwx files to achieve the two functions. The answer is that you can do it either way.
In order to achieve editing you will need to:
  1. Read the file (your other code already does this).
  2. Place the file in a textarea element in an HTML form and present it to the user. You may or may not want to go through the trouble of offering rich text editing, like this forum does. If you do, then you will need to use one of the many rich text editing components available.
  3. Serve the page to the user for editing. The page will be submitted to yet another fwx file (or the same one, but in that case you will need to run different sections, depending on user input).
  4. Save the submitted content back to the file. 
FoxWeb Support Team email
Sent by Art Bergquist on 05/29/2015 04:11:46 PM:
Sorry, I may have misconveyed the scenario; we already do the following with no problem: 
  • Display dynamic content, some of which is read from a separate HTML file.
 I'm looking for help on doing the following:
  • Provide the ability to edit an HTML file.
Sent by FoxWeb Support on 05/29/2015 04:05:50 PM:
You are dealing with two distinct functions:
  1. Display dynamic content, some of which is read from a separate HTML file.
  2. Provide the ability to edit an HTML file.
There only thing the two functions have in common is that they read the same HTML file, which is achieved with a single line of code. Are you trying to combine the two functions simply to encapsulate related functionality in a single file, or is it so that you can display an Edit link in the dynamically generated output of function #1 above? If it's the latter, then you can still break the two functions in two separate .fwx files. One would perform function 1 and also return a link that would point to the second file, which would perform function 2 and then re-direct or link to the first file.
FoxWeb Support Team email
Sent by Art Bergquist on 05/29/2015 03:19:41 PM:
 Hi all,
I've been maintaining a FoxWeb web site for a while now.  I am confident in the fixing/enhancing of existing web pages within the site and have also implemented some new web pages.
A particular new web page has, for some reason, proven a bit more challenging for me.  We are currently maintaining an HTML file that is read by an .FWx file; the .FWx file incorporates the contents of the HTML file (primarily, text and links) and combines it with other HTML which it then renders.  That all works fine.
We now want to enable the client to edit the HTML file himself (that way, he doesn't have to communicate the changes to me and wait until I get a chance to do that myself).
Specifically, I want to implement a web page that does the following:
  1. reads the contents of the HTML file and displays them in an edit box
  2. allows the user to modify that HTML within the edit box
  3. when the user clicks [Save], overwrites the HTML file on the web server with the new HTML
Can I do the above via one (1) .FWx or does it require two (2) .FWx files?
Art Bergquist