[Zope] avoiding nested DTMLs
Casey Duncan
cduncan@kaivo.com
Mon, 19 Mar 2001 17:14:55 -0700
Timothy Wilson wrote:
>
> Hi everyone,
>
> I'm trying to figure out how to do something here while avoiding nested dtml
> tags. Here's what I've got:
>
> I have a TinyTable containing two fields: "name" and "status". I have a DTML
> Document in the same folder as the TinyTable for each "name" in the
> TinyTable. I want to display that DTML Document based on the value of
> "status" in the TinyTable.
>
> Here's some code:
> <dtml-in testTable>
> <dtml-if "status <> ''">
> <p><<< insert DTML Document here >>></p>
> </dtml-if>
> </dtml-in>
>
> So in the code above I want to insert <dtml-var spam_html> (which is a DTML
> Document in the current folder), for example, if the TinyTable contains a
> line that looks like:
>
> "spam_html", "X"
>
> I hope I'm making myself clear. Anyone have any ideas?
>
> -Tim
>
Possibly this (untested):
<dtml-in testTable>
<dtml-if status>
<p><dtml-var expr="_[status]"></p>
</dtml-if>
</dtml-in>
I don't see any way to safely avoid nesting the dtml-if tag, if status
might be empty. This is not anything I would consider a problem though.
--
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>