installation |
giving users access![]() |
There's some more options, but if that seems sufficient for your uses you can continue on to configuration.(emphasis added, of course)
Rita's Rodent Ranch is located at <b>1024 S. Wilson Ave.</b>. We can supply all your hamster, rat, and rabbit needs! Our hours are: <b>
<!-- #BeginEditable name="hours" -->
10:00am - 7:00pm
<!-- #EndEditable -->
</b>
The syntax is borrowed from Dreamweaver. Actually, Dreamweaver's templates work the same way, so if you make a template in Dreamweaver and edit it with ComfyEdit, you'll be allowed to edit all the portions that are marked editable in the template. This might be useful...?
You can put these editable regions anywhere in the document, the only restriction being that if you put them inside an HTML tag browsers would barf on it. (So you can't allow people to edit only the keywords of a document) You can allow people to edit the title, pieces of the body, or whatever.
The name is optional, and using name="something" can be shorted as just "something" as long as it's the first thing after BeginEditable. You can even leave out the name, and the section will just be labeled item #.
Of course, you can have more than one editable region in a page.
You can also give some options as to how the editting form will appear:
There's two filters included:
I don't currently have many useful checks. You'll have to write your own as appropriate.
You can add your own checks. Look in checks.py, there are
instructions at the top of the file. (If you find some checks
particularly useful, mail me
and I'll include them)
Configuring ComfyEdit
There is very little configuration required for ComfyEdit. If you
edit the (text) file comfyedit.cgi, you will find a line near the top
that looks like:
allowed_directories=[""]This is a list of paths and filenames that can be editted. You can use normal file-globbing characters, like *.html and so on. A * at the end of a path will match all pages, all subdirectories, and all the pages in those subdirectories.
Example: if you want people to be able to edit any files under /var/www and /home/bob, and the particular file /home/jane/public_html/contact.html:
allowed_directories=["/var/www/*", "/home/bob/*", "/home/jane/public_html/contact.html"]Note: this is only half the process for allowing editting. You can still only edit files that have the proper permissions (as described in the following section).
If you want to do other configuration, you can fairly easily edit the
colors used in the browser, all of which are located near the top of
the comfyedit.cgi file. You can change the appearance of the
editor by changing html/edit_header.html and
html/edit_footer.html
Setting file permissions
(These sections of the instructions strongly assume a Unix system.
If you know how this is done on other types of systems, tell me and
I'll include that information)
In order for ComfyEdit to be able to edit files, it has to have permission to write them.
The web server -- and all CGI scripts -- usually run as the nobody user (though not always -- on Debian it's www-data). So the nobody user has to have permission to write the file. One way to do this is to allow anyone to write to the file:
% chmod a+w somefile.htmlAnother, somewhat more secure method is to change the file's group to nobody and then allow that group to write the file:
% chgrp nobody somefile.htmlComfyEdit tests if you have permission to write to a file, and doesn't let you edit a file if not.
% chmod g+w somefile.html
(If you have more pointers for other web servers or environments, mail me and I'll include them)
installation |
giving users access![]() |