[Zope-CMF] Re: [dev] enhancing Actions: a rough proposal

yuppie y.2005- at wcm-solutions.de
Wed Jan 12 10:14:18 EST 2005


Chris Withers wrote:
> yuppie wrote:
> 
>> Hope we are both talking about a TALES expressions that is part of the 
>> Action object.
>>
>> One example was this expression:
>>
>>     python:object.getPortalTypeName() in ('File', 'Image')
>>
>> If you add a new type that should also use this Action, you have to 
>> modify the expression. Its quite hard to do that in an automated way.
> 
> 
> 'fraid not. Why would you have to modify that expression?

???

I try it again:

Using the example expression as Action condition makes sure that the 
Action is only shown for 'File' and 'Image' objects.

Adding a new portal type 'Foo', the condition will be false for 'Foo' 
objects.

If we want to show the Action also for 'Foo' objects, we have to modify 
the expression like this:

     python:object.getPortalTypeName() in ('File', 'Image', 'Foo')


Cheers, Yuppie




More information about the Zope-CMF mailing list