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
On Tue, Feb 15, 2005 at 04:52:12PM +0000, Dale Strickland-Clark wrote:
Alternatively, is there some other test I can make to see if this is running inside a macro or not?
Maybe just check the template id? tal:condition="python:template.getId() == 'footemplate'" -- Paul Winkler http://www.slinkp.com
That works beautifully. You see? I knew I was making a meal out of it. Thanks. On Tuesday 2005 February 15 17:42, Paul Winkler wrote:
On Tue, Feb 15, 2005 at 04:52:12PM +0000, Dale Strickland-Clark wrote:
Alternatively, is there some other test I can make to see if this is running inside a macro or not?
Maybe just check the template id?
tal:condition="python:template.getId() == 'footemplate'"
-- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk
participants (2)
-
Dale Strickland-Clark -
Paul Winkler