[Zope-CMF] CookedBody exposure

Tres Seaver tseaver@palladion.com
Thu, 27 Sep 2001 12:49:08 -0400 (EDT)


On Thu, 27 Sep 2001, Meilicke, Scott wrote:

> Hello,
> 
> I'm trying to insert a document into another with:
> 
> <dtml-var addEntryForm>
> 
> which gives me headers and footers - not good.
> 
> <dtml-var addEntryForm.CookedBody()>
> 
> gives me:
> 
> This resource may be trying to reference a nonexistent object or variable
> addEntryForm.CookedBody()
> 
> I have also tried a variety of 
> 
> <dtml-with addEntryForm>
> 	<dtml-var CookedBody()>
> </dtml-with>
> 
> solutions with no success.
> 
> I've searched the cmf list and have only found solutions for catalog
> searches and lists via <dtml-in>.  I know this should be easy...
> 
> additional note - this applies to both portal Documents and DTML methods. Do
> DTML methods have a CookedBody?  If not, how do I expose the rendered
> internals without headers/footers?

You've been bitten by the difference between DTML name lookup
('<dtml-var name="foo">', normally shortened to '<dtml-var foo>') 
versus DTML expression evaluation ('<dtml-var expr="foo()">',
often abbrviated '<dtml-var "foo()">').

In your case, you need to pick one or the other.  Either::

  <dtml-var expr="addEntryForm.CookedBody()">

or::

  <dtml-with addEntryForm>
    <dtml-var CookedBody>
  </dtml-with>

I prefer the first, in your case, and I have tried to quit using
the shortcut form for expression evaluation.


Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com