[Zope] render/parse function ? (using <dtml-var x> in a propertysheet ?)sheet ?)

Michel Pelletier michel@digicool.com
Sat, 08 Apr 2000 16:07:51 -0700


chas wrote:
> 
> Sorry to bother you all again, but solving this problem
> would save a lot of jumping through hoops and I was
> surprised that nobody else has encountered it.
> 
> Consider :
> - we have a ZClass string property called 'myproperty'.
> - we set the value of 'myproperty' to "Hello <dtml-var FirstName>"

How is this different than just creating a string property called
'FirstName' and:

Hello <dtml-var FirstName>

instead of <dtml-var myproperty>?

>   where FirstName is a variable whose value is set to 'Fred'
> - we now try to render the value of 'myproperty' inside a DTML
>   method using the DTML :
>         <dtml-var myproperty>
> - as would be expected, the following is displayed -
>   "Hello <dtml-var FirstName>" since it is just a string.
>   But really we wanted it to display "Hello Fred"
>   ie. to evaluate the DTML tags.
> 
> Is there any method that can be called to parse
> the value of a property and evaluate the DTML ?

I see what you want to do here, coincidentally someone else asked
something similar today.  I'm not sure how useful it would be though. 
Perhaps you could think up some more interesting use cases than what you
have here and put them on the InterfaceWishList:

http://www.zope.org/Members/michel/Projects/Interfaces/

-Michel