[Zope] Conditional sections
Dale Strickland-Clark
zope at d.strickers.org.uk
Tue Feb 15 11:52:12 EST 2005
Hi list.
I've been chewing this over for a while and my solutions seem unduly
complicated. I wonder if I'm overlooking something simple.
I have a page template which contains a macro. This template is used by itself
and also called from other pages which invoke the macro.
When called as a macro, I want two images included which I don't want when it
is called alone.
Here's an extract:
<img tal:replace="structure here/images/q66" tal:condition="includeimage" />
<div metal:define-slot="body">
Some default content...
</div>
<img tal:replace="structure here/images/q99" tal:condition="includeimage" />
What I /think/ I need is some code I can put before the <tal:macro-define...>
that sets some variable I can test in this tal:condition.
Alternatively, is there some other test I can make to see if this is running
inside a macro or not?
Thanks.
--
Dale Strickland-Clark
Riverhall Systems - www.riverhall.co.uk
More information about the Zope
mailing list