Webedit allows you to update your own website, without requiring knowledge of HTML, FTP, or the layout or structure of the site.
Webedit can edit HTML, XML and plain text files. Written in PERL, this script runs on your webserver and reads the files straight off the server's hard drive. It displays the contents of the file in your web browser, and allows you to add, edit or delete any row or line of data in the file. When you click Publish, the script writes the file back onto the server's harddrive. This has the effect of instantly updating your website - no waiting for webmasters, and no paying them either!
Webedit has special support for HTML tables, and can load each cell in the table as a separate editable dataitem.
Webedit is particularly suited for occasions where your website has a table of data that gets changed regularly (such as a list of gigs) or a file of data that gets changed regularly, for example, a pricelist. There's no need to pay a human to make this kind of repetitive change. This software lets you update your gig listing, or whatever, as often as you like, from any web browser.
Webedit includes a preview mode, password-protection, and full logging capability.
 
- Requires PERL5 or higher.
- Requires password-protected directory support
- This program is licensed according to the license document LICENSE.PDF, bundled with the program.
 
Note: the directoryname 'dev' has been used throughout this documentation, however any directoryname may be used.
- extract the contents of the distribution archive to a directory of your choice
- ensure the file(s) to be edited conform to these specifications
- configure the script:
- change bangpath (first line)
- change $PAGE_URL (for security reasons, the script can only be called from $PAGE_URL) - the address of editor.htm
- change $SCRIPTNAME
- change $STYLESHEET
- change $STYLELINES
- change $HELPFILE
- change $LOGFILE
- configure editor.htm: replace variables; add/remove If (option=x) {} blocks (more info here)
- create a directory 'dev' on the server to hold editor.htm
- upload editor.htm and help.htm to 'dev'
- upload file(s) to be edited in ASCII (text) mode*
- change permissions on file(s) to be edited to 666 (rw-rw-rw)
- upload any support files (stylesheets, images, scripts etc) as usual
- upload script in ASCII (text) mode
- change permissions on the script to 755 (rwxr-xr-x)
- password-protect the directory on the server holding editor.htm
- create a 0-byte logfile
- test
* Note: if you do not upload your file(s) to be edited in text mode, you may still be able to see them in the editor, however when 'edit' is clicked, the edit field will not be populated. This is because the trailing CR/LF which is left in the file, if text mode is not used, is displayed instead.
how to migrate to a new server:
- retrieve current edited pages from the old server
- change the page setting in each block of editor.htm (in the 'dev' directory) to reflect the new paths to the pages to edit
- follow the installation procedure above, starting from step 5, create the 'dev' directory
how to uninstall:
- delete the script from the webserver
- un-password-protect the dev directory
- delete the dev directory from the webserver
- change permissions on file(s) to be edited to 644 (rw-r--r--)
- delimiters and class= HTML might also be removed from the file(s) to be edited, although this is not necessary, and will make re-installing more burdensome
 
The file editor.htm performs three main functions: authentication, page configuration, and script execution.
- authentication: editor.htm is placed in a password-protected directory on the server. It cannot be accessed without this password. Similarly, the script can only be executed by editor.htm. In this way, the script can only being executed by someone who has the password.
- page configuration: editor.htm prompts the user with a form to select a page to edit. Upon selection, a Javascript fills hidden fields in the form with the appropriate configuration data.
- execution: When the user clicks 'continue', the editor is executed using the configuration data supplied.
editor.htm contains multiple configuration blocks, one for each page available to the editor. Each block contains a number of variables which tell the editor how to handle the page. The variables are as follows:
| variablename | meaning |
| formtitle | displayed in the titlebar of the browser on the editing screens, eg. GIG MANAGER |
| page | * the fully qualified path to the file to edit, eg. /home/virtual/site11/fst/var/www/html/training.htm or /programs/perl/htdocs/training.htm |
| section | section within the specified page to edit, eg. dates [1] |
| tag | * tag within the specified section to edit, eg. table [2] |
| myclass | * stylesheet class denoting editable tags, eg. edit [3] |
| columntitles | the title of each column on the editing page, eg. date,venue,location. For non-tabulated data, a single value may be used. |
| columncomments | comments to be displayed alongside each field on the edit and add item pages, eg. when is the party?,which club?,where is the club?. For non-tabulated data, a single value may be used. |
| tablehtml | ** HTML to insert into the table on the preview page only. This is used simply to make the preview page look like the published page. eg. border=0 cellpadding=2 cellspacing=0 bgcolor=#EEAA00 |
| rowhtml | ** HTML to insert into each <TR> tag of each row in the table (used on the preview page *AND* in the published page). This is used to control the formatting of each row in the table. eg. valign=top |
| cellhtml | ** HTML to insert into each <TD> tag of each cell in the table (used on the preview page *AND* in the published page). This is used to control the formatting of each cell in the table. HTML for each column in the table is separated by a comma. eg. class=bodysml nowrap,class=bodylite |
| headings | if set to YES, output will have date headings inserted, eg. YES [4] |
* denotes required field
** table mode only
[1] Notes:
- all lines between the two delimiting comments are processed: <!-- delimit-start-[sectionname] --> and <!-- delimit-end-[sectionname] -->
- the two delimiting comments must be on a line all by themselves, at the beginning of the line
- [sectionname] is substituted for the name of the section, passed as a variable by editor.htm
- if the section is not specified in editor.htm, webedit will assume the entire file is to be edited, and will load it without parsing, in "fullfile mode"
- in fullfile mode, page is the only variable that must be populated by editor.htm and sent to webedit
[2] Notes:
- the editor supports two markup editing modes at present; table mode and closed tag mode
- table mode is selected by specifying table as the tag to edit
- closed tag mode will be selected if the tag to edit is not "table"
- closed tag mode requires the full content of the tag be on the same line in the file
- table mode requires that tablecells must be all on the same line in the file, like this: <tr><td></td><td></td> ... etc
- a "closed tag" is one that has both opening and closing elements, eg. <P> and </P>
- the editor will work with any closed tag
- table mode only: tabledata cannot have three underscores anywhere within it
- table mode only: tabledata cannot contain nested tables
- table mode only: the number of columns per row must be the same for each row
[3] Notes:
- Although stylesheets are used in this technique, no change to page appearance is intended or expected. Rather, the page elements cast with a certain stylesheet are recognised by the editor and loaded as editable. This feature allows the editor to ignore page elements, even though they are the correct tag, in the editable section, in an editable page. Note however that ignored page elements are not output back to file. Indeed, once webedit has published the page, the only HTML that will be left between the delimiting lines will be that generated by webedit itself.
- A page element is usually cast into a certain style using the HTML class=. However, the editor also uses this to identify editable tags. Therefore:
- in tablemode, tablerows must begin with the following: <TR class=edit
- in closed tag mode, the tag must be cast into the "edit" style like this: <P class=edit
- The actual name of the style used (in the above example, it was "edit") is specified by the myclass parameter in editor.htm
[4] Notes:
- This is a legacy feature that is maintained for compatibility purposes.
 
How to access the editor
- open a web browser such as Internet Explorer or Opera
- go to http://www.yourdomain.com/dev/editor.htm
- enter your username and password
The editor's page selection screen will then be displayed.
How to edit a page
- access the editor (as above)
- select a page to edit
- click Continue
- click Edit next to the row of data you wish to change
- change the text as appropriate
- click Change
- repeat steps 4-6 for each row of data you wish to change
- when done, click Preview
- if you're happy with the changes you have made, click Publish, otherwise click Cancel
When the Publish button is clicked, any changes you have made will be applied to your website. You can abandon all your changes without applying them to your website by clicking Cancel on the row selection screen.
If you want to add a row of data to the page, click Add next to a row of data above or below the row you wish to add. You will then be able to enter the new data, and select whether it goes above or below the row you clicked Add next to.
If you want to remove a row of data from the page, click Delete next to the row you wish to remove.
 
- There are various limitations on the data and pages provided to webedit. See the configuration section for more information.
 
- add some style!
- allow markup: allow user to apply styles to selected text from list of detected styles in pre-defined stylesheet
- allow markup: bold, italic, stylesheet entries?, left/right/middle align, onsite/offsite link
- up/down item controls
- put cursor in form field on edit/add pages
- CSV support
 
| August 2003 | 0.01 | initial development |
| September 2003 | 0.02 | initial release |
| December 2003 | 0.03 | improved to work with any table |
| January 10, 2004 | 0.04 | improved look-and-feel |
| January 16, 2004 | 0.05 | bugfix to permit embedded HTML |
| January 19, 2004 | 0.06 | added ability to handle multiple pages; added online help; bugfix to permit embedded quotation marks |
| January 28, 2004 | 0.07 | added ability to handle multiple sections within a single page; added ability to insert HTML into a prespecified tablerow tag |
| February 2, 2004 | 0.08 | added ability to handle other HTML tags such as P and OPTION; reworked to allow configuration via a form |
| February 12, 2004 | 0.09 | bugfix |
| April 4, 2004 | 0.10 | added logging, ability to edit any text file, and documentation |
| June 5, 2005 | 1.10 | improved documentation, commercial release |
|