[Zope] Can ptl do this?

KevinL darius@obsidian.com.au
28 Aug 2002 13:45:07 +1000


Hey all,

I have a macro, as follows:

<metal:block define-macro="std">
      <tr>
        <td colspan="3" class="help">
          <i><metal:block define-slot="help"></metal:block></i>
        </td>
      </tr>
      <tr> 
        <th align="right" valign="top">
          <metal:block define-slot="name">NAME</metal:block>
        </th>
        <td colspan="2" class="textEntry" valign="top">
          <metal:block define-slot="content">CONTENT</metal:block>
        </td>
      </tr>
</metal:block>

It renders a three-item block, consisting of name, value, and help
text.  This is the "pda" version - it gets called for clients that are
pda's, and stacks the help text above the name/value, so it displays
nicely on a pda - the normal version strings them side-by-side.

The html designer's come back to me and said "that's great, but I've got
instances where there is no help text - and I'd like the tr to not
appear when there's no help text".

I really don't want to have to pull this whole thing into python - at
the moment, the guys doing html have control over this, it's the
smallest item they do have control over, and with it they can fairly
significantly change the layout of the site (in conjunction with styles
etc).  Ideally, I need some way to put a conditional into the macro, so
that the first tr is only rendered if there's content for the help slot.

Is this doable?

KevinL