[Zope] [ZGotW] Issue #5 (Open)

Zope Guru of the Week ZGotW@palladion.com
Fri, 18 Feb 2000 08:00:42 US/Pacific


A new issue of "Zope Guru of the Week" is available:

===================================================================
Issue #5 -- Rendering DTML in Properties
===================================================================

       Status:  Open 

    Zen Level:  Disciple (3/8)

     Keywords:  DTML ZClasses 

 Submitted by:  Chuck Burdick chuck.burdick@tradingtechnologies.com
-------------------------------------------------------------------
This problem occurs when you try to make a DTMLDocument-ish ZClass.

1. Suppose you have created a ZClass that you call 'myClass'.

1. Give 'myClass' a property sheet called 'properties'.

1. Create a text property called 'content' on 'properties'.

1. Create a view to edit 'properties'.

1. Create an instance of 'myClass'.

Q: If you put dtml tags in 'content', how can you render the object and
interpret the tags?

For example, suppose you created 'index_html' as a DTMLMethod in 'myClass'
as::

  <dtml-var standard_html_header>
  <dtml-var content>
  <dtml-var standard_html_footer>

This will not work.  It will display the text value of 'content' but the
dtml tags will not have been evaluated.  This is a problem I frequently
encounter.  I do not want to create a complicated subclass of the existing
DTMLDocument classes.  Instead, I want a quick-and-dirty ZClass in which
DTML tags are valid.
-------------------------------------------------------------------

To reply and win undying glory and mondo guru points:

  http://zope.palladion.com/demos/ZGotW/5