[Zope-dev] More comfortable DTML editing ?

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Sat, 16 Oct 1999 11:00:38 +1000 (EST)


On Fri, 15 Oct 1999, Andreas Jung wrote:

> Editing DTML in a textarea input is very annoying.
> Will there be a better solution in the future of Zope ?

Here part of a pipe dream I had recently:

Create a Product called 'Forms'. It lets you build forms using
various subobjects. eg. You would create a 'form', put inside it
a 'button', and maybe a 'fieldset' which contains a load of 'radios'.
You get the picture. It would be coded as DTML tags, probably one for each
of the existing HTML form tags.

What is interesting, is that the rendering of the forms doesn't have to
be boring HTML, although it will default to that. For instance, I might
set attributes that enable client side type checking in javascript, or
selectivly enable/disable form elements. I might also, depending on the 
settings in a a cookie, run a Java applet (jpython anyone?) for nicer 
editing. This Java applet would start just doing syntax highlighting, 
but could then be extended to include editing mode (vi, emacs, Windows) 
depending on a cookie, client side DTML syntax checking, conversion of 
<!--#dtml tags to <dtml- tags, whatever.

Once this basic framework is setup, it is then a case of rebuilding the
DTML forms used by the Zope management interface to use the new Forms
product. Suddenly, you have a management interface that is still usable
with Lynx, but also provides an all-singing-all-dancing development
environment if your brower is JavaScript 1.1 and JDK 1.1 compliant.

<dtml-form action='gohere'>
    <dtml-fieldset>
	<dtml-textarea type=dtml name=text> 
    </dtml-fieldset>
    <dtml-input type=submit name=submit value=submit>
</dtml-form>

Hazy section that probably won't work well:

    If all this is successful, add an attribute to DTML methods and documents
    to 'use smart forms'. If set, you just use standard HTML form tags in
    the edit windows and it actually stored as dtml-form tags. This is were
    it got all hazy, as external editors of which I know little start getting
    in the way :-) It would be nice if someone could create a HTML document
    in Claris home page, add 'type=html' to the textarea element, and when it 
    is displayed from the Zope site, they get a nice GUI HTML editor embedded 
    in their web page instead of their boring textarea.

 ___
   //     Zen (alias Stuart Bishop)     Work: zen@cs.rmit.edu.au
  // E N  Senior Systems Alchemist      Play: zen@shangri-la.dropbear.id.au
 //__     Computer Science, RMIT 	 WWW: http://www.cs.rmit.edu.au/~zen