[Zope] Automatically including another document
Chris McDonough
chrism@zope.com
Thu, 20 Dec 2001 18:53:33 -0500
Bruce Eckel wrote:
> Here's what I'm trying to do: in a subdirectory off the current
> one, called "book", there is a file with the same name as this one,
> and I want to include it in the current DTML document. Here's what
> I have so far:
>
> <dtml-with book>
> <dtml-let text="_['URL'].split('/')[-1]">
> <dtml-if text>
> <dtml-var text>
> </dtml-if>
> </dtml-let>
> </dtml-with>
>
> The problem is, <dtml-var text> simply spits out the name of the
> document, rather than the document contents.
>
> (I feel like I've struggled with this before...).
>
> Is it possible?
>
Try this (assuming it's in a DTML document, otherwise get "thisid" in
your workarond manner as per the last message):
<dtml-let thisid="getId()">
<dtml-with book>
<dtml-var "_[thisid]">
</dtml-with>
</dtml-let>
--
Chris McDonough Zope Corporation
http://www.zope.org http://www.zope.com
"Killing hundreds of birds with thousands of stones"