[Zope] Re: Howto test if macro evaluates to nothing

Florian Schulze florian.proff.schulze at gmx.net
Wed Mar 10 11:41:53 EST 2004


On Wed, 10 Mar 2004 14:30:24 +0000, Chris Withers <lists at simplistix.co.uk> 
wrote:

> Florian Schulze wrote:
>> I would like to know wether there is a way to test if a macro evaluates 
>> to nothing.
>>
>> I tried the following:
>> <div tal:condition="here/my_macros/macros/macro_name"
>>      metal:use-macro="here/my_macros/macros/macro_name">
>> </div>
>>
>> But the macro returns a tree of lists and tuples.
>
> I thnk you're misusing the macro feature here.
> Why does you macro substitution end up in not generating any output in 
> certain circumtances?
>
> cheers,
>
> Chris

It's the normal way it works in plone. There the macro portlet_fetcher 
calls several macros of which some might be empty, because the user is not 
authenticated or there is just nothing to show. I would like to add some 
markup around those portlets and currently I have to edit each portlet 
macro, because the markup shouldn't be there when the macro is empty.

Thanks and regards,
Florian Schulze




More information about the Zope mailing list