[ZPT] Re: Problems with context and rendering and DTML and... a
story of failure and puzzlement
Steve Spicklemire
steve@spvi.com
Thu, 21 Jun 2001 19:30:24 -0500
Evan,
Perfect! Thank you! I think that ZPT is so different from DTML... it
just takes a bit to get your head wrapped around it. I guess
thanks again,
-steve
Evan Simpson wrote:
>
> steve wrote:
>
> > <dtml-call "REQUEST.set('activeTab',REQUEST.get('activeTab',0))">
> > <table border="0">
> > <tr>
> > <dtml-in tabList>
> > <dtml-if "_['sequence-index']==activeTab">
> > <td align="center" width=97 height=19 background="frontTab.gif"><a href="&dtml-target;">&dtml-label;</a></td>
> > <dtml-else>
> > <td align="center" width=97 height=19 background="backTab.gif"><a href="&dtml-target;">&dtml-label;</a></td>
> > </dtml-if>
> > </dtml-in>
> > </tr>
> > </table>
>
> <table border="0"
> tal:define="activeTab python:request.get('activeTab', 0)">
> <tr tal:repeat="tab tabList">
> <td align="center" width=97 height=19 background="frontTab.gif"
> tal:define="index repeat/tab/index"
> tal:attributes="background python:test(index==activeTab,
> 'frontTab.gif', 'backTab.gif')">
> <a href="/" tal:attributes="href tab/target"
> tal:content="tab/label">Label</a></td>
> </tr>
> </table>
>
>
> > Specifically.. is there anything like 'sequence-index' in ZPT?
>
> See the documentation for the repeat variable, (newly) located at:
>
> http://dev.zope.org/Wikis/DevSite/Projects/ZPT/RepeatVariable
>
> >>What does 'container' mean? I expected it meant the container of the
> >>template that defined the macro. Anyway... I decided that
> >>'here/Structures/biopsyTypes should work in both places
>
> All TAL expressions get executed after all macros have been completely
> expanded, and they don't know anything about the macros' environment.
> That's why they're *macros*, not method calls. So 'container' in or out
> of a macro always refers to the container of the currently executing
> template. I'm not sure that there's a clean way to do what you
> intended, right now.
>
> Cheers,
>
> Evan @ digicool