EditTag is an enhancement of the functionality of PointEdit. The EditTag scripts render the page on which changes are made to the HTML file using the surrounding content of the page. In consequence, an EditTag-enabled page will have its edit screen look very similar to its public appearance. EditTag's functionality allows for:
When to use EditTag
EditTag is not intended as a template language. If you find yourself
wishing for variable substitution, conditionals and loops, you should consider
using a language such as PHP, which will
allow for complete control over the document. EditTag is intended for use
to separate the bulk of page layout from editing more dynamic content within
the page. EditTag-enabled documents can provide administrators with no
knowledge of HTML a great deal of control over the content, and even appearance,
of a document, while shielding the bulk of the layout from any accidental
errors which would disable the page.
Choosing and configuring directories for a protected installation
For a protected installation, you will use the HTTP password authentication
provided by many web servers (such as Apache) to provide security for EditTag.
Choose a directory in which to install EditTag and create it on your server.
You'll then need to password protect the directory. Doing this may vary
quite a bit depending on your server setup. If you are using an ISP, they
likely have tools which you can use to password-protect the directory.
If you are running your own Apache
server, you can use the sample htaccess and htpasswd
files in the EditTag distribution on which to model your own. You'll need
to use the htpasswd -c /local/path/to/directory username command
to add passwords (or you can use Perl or a number of other tools). In this
case, you'll install all the scripts to the same (password protected) directory,
and not use any EditTag passwords (documented below).
Choosing and configuring directories for a public installation
For a public installation of EditTag, you don't need to worry about
creating access or password files; you can use the EditTag built-in password
system to control editing access to your files. Choose a directory on your
web server to hold EditTag, and make sure that directory exists and you
can execute CGI scripts from it. Depending on your server, this may restrict
you to a cgi-bin directory, or a mod_perl-specified directory,
or you may have more freedom in the selection.
Steps to follow for all installations
EditTag.cgi
ParseScript.cgi
To EditTag-enable your HTML documents, you include special extension
tags to those documents which let EditTag know what you want to do.
Control tags
<EDITTAGPWD z98rGjLyQ11bN>The EDITTAGPWD command sets a password for this file. The argument is an encrypted password, which can be generated using the "mkpw.cgi" script included in the package. The password is one-way encrypted, so its appearance in the public HTML document does not give a viewer the ability to guess the password. As for any other password, use fairly long passwords (around 8 characters) which aren't dictionary words or easily guessed; include letters, numbers, other symbols. If this tag is not present, EditTag will not require a password to edit the file. This can be the desirable action, if the EditTag scripts are placed in a protected directory, which requires a password to browse. Using the ability of EditTag to create files in a directory, there are applications of EditTag (such as collecting user comments) in which it may be desirable to allow public access to a particular file. This is up to you as the user to determine.
<EDITTAGMAIL someone@somewhere.com>This tag specifies the receiver for email notification when the page is edited by someone. In order for email to be sent, this tag must be present in the file, and email notification must be turned on in the EditTag scripts (see above) during installation.
<EDITTAGSRC /the/path/to/this/file.html>Specifies the source path for the document. This may be necessary if the EditTag scripts are located in an out-of-the-ordinary place, or if the renderer and parser script are in different directories. If it is not present, the scripts will deduce the source path from the pathname passed to them to open the file for edit.
<EDITTAGDEST /the/path/to/the/destinationfile.html>Specifies the destination path for the edited document. This is where the file will be written incorporating any edits. If not specified, the scripts will assume that the destination for the edits is the same as the source file: that is, any edits will be written back to the original file. If a directory is specified here (leave the trailing slash to specify a directory), the script will create a new file in that directory and write the edited file to it. This can be used to let an administrator review "page submissions" from users, by specifying a password-protected directory as the destination and then renaming the submitted files to a public directory after approval.
<EDITTAGURL http://www.somewhere.com/path/destinationfile.html>This tag specifies a URL for the destination file. This is to make the output of the edit parser easier to use: it will make a link to the edited version so that changes can be inspected, and also mail the URL if notification is used. If a directory is used in the EDITTAGDEST file, leave the URL specified a directory as well (i.e. "http://www.somewhere.com/a/directory/") and the chosen unique filename will be spliced on to send as notification and present to the user.
Editable Field Tags
<EDITTAG TYPE=type WIDTH=l HEIGHT=s NAME=name PROMPT=prompt POS=pos TABLE=yes TRANSLATE=no>This is the main EditTag field tag, which specifies an editable field, options for how its edit box will be rendered, and its present value. Since browsers do not know the <EDITTAG> and </EDITTAG> tags, they will suppress them, and all users will see is the present content of the field, whatever it is. Each EDITTAG field must occur on its own line in the input file. Options to this tag are as follows:
Some default content
</EDITTAG>
|
default = line |
|
|
|
|
default = 40 |
| In a line context, this indicates how large the edit box
will be. In an area context, indicates how wide the edit box will be. In
a select context, does nothing.
|
|
|
default = 3 |
| In a line context, does nothing. In an area context, sets
the height of the edit box. In a select context, sets whether the select
will be single line or multi-line, and how many lines will show.
|
|
|
required |
| This identifier must be unique for every field in the EditTag
document. An additional restriction is that no identifier must be equal
to the prompt used for the tag edit prompt (see below). This is the name
that EditTag gives internally to each field.
|
|
|
no default |
| An optional prompt to use for the user when rendering the
edit page.
|
|
|
default = left (position of prompt) |
| Where to place the prompt in relation to the edit field.
Illustrated here with PROMPT="Enter title:"
|
|
|
default = yes |
| This tag sets whether or not to use the PROMPT, POS attributes
and utilize a table to control the appearance of the edit field, or just
render the edit field (as above) with no prompt, and in-line with the surrounding
text. It can be useful when the surrounding text or in-file labels are
sufficient to identify the field, and can yield a more WYSIWYG look to
the resulting edit page.
|
|
|
default = no |
| Controls whether or not HTML translation is done for this
field. If the option is YES, EditTag will translate any double line-feeds
to the <P> HTML tag, which causes a paragraph break in HTML. This is
useful in the AREA context, and for page editors who may not know HTML.
|
|
<ANYTAG label="value" label2="value2" EDITTAG="Insert (unique) prompt here">This use of EDITTAG is as an argument to another tag. Since the browser does not know the meaning of the EDITTAG label in the context of any tags, its presence will be ignored. This tag must be used on its own line in the source file. When EditTag processes the file, it will produce an editable field which looks something like this:
<EDITTAGOPTION option>
This tag is used in conjuction with the <EDITTAG TYPE="select">
command. It specifies the options that will appear in the HTML form select
element on the edit page. The currently-selected option comes outside any
tags, so the whole statement might look like this:
<EDITTAG NAME=sel1 HEIGHT=1 PROMPT="Make selection">
<EDITTAGOPTION option number one>
<EDITTAGOPTION option number two>
<EDITTAGOPTION option three>
option number two
</EDITTAG>
<EDITTAGQUIET> and </EDITTAGQUIET>These tags will stop the EditTag input screen from showing any output between the QUIET tags. That is, the normal "WYSIWYG" output is suppressed. This is a good thing if other tags on the target page are interfering with the tables that EditTag constructs for input. If you only wanted to see the prompts, you can enclose must of the file in QUIET tags and then only prompts will be displayed on the input screen.
Again, the browser doesn't know any of these tags, so the only thing visible to the surfer visiting the public page is the currently selected option: "option number two". These tags must be used on their own lines in the source file.
For examples of how to use the tags in more realistic situations, and
to see the results on the visible pages, inspect the HTML source for the
test files.