[Zope-CMF] CookedBody exposure
Meilicke, Scott
scott.meilicke@intp.com
Thu, 27 Sep 2001 12:17:33 -0700
<dtml-var expr="myfile.CookedBody()"> works. Thanks.
However:
Within my index_html file I put:
<dtml-with addEntryForm>
<dtml-var CookedBody>
</dtml-with>
where addEntryForm is a portal Document, gives me an error:
This resource may be trying to reference a nonexistent object or variable
CookedBody.
Because index_html and addEntryForm are in the same folder, is there
something else I have to do?
Thanks - Scott
-----Original Message-----
From: Tres Seaver [mailto:tseaver@palladion.com]
Sent: Thursday, September 27, 2001 9:49 AM
To: Meilicke, Scott
Cc: 'zope-cmf@zope.org'
Subject: Re: [Zope-CMF] CookedBody exposure
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