[Zope3-Users] Re: Readout content/factory/title

Philipp von Weitershausen philipp at weitershausen.de
Thu Mar 10 11:17:55 EST 2005


Florian Lindner wrote:
> Am Dienstag, 8. März 2005 21:59 schrieb Stephan Richter:
> 
>>On Tuesday 08 March 2005 11:50, Florian Lindner wrote:
>>
>>>ow can I read out ZCML: content->factory->title of a given object? In ZPT
>>>and Python?
>>
>>I do not understand this question.
> 
> 
> I register a content object with:
> 
> <content class="...">
>   [...]
>   <factory title="The title I want to read out" />
>   [...]
> </content>

What do you mean by "read out"?

> The apidoc describes the attribute as:
> 
> Text suitable for use in the 'add content' menu of a management interface

This is old documentation. We register menu items in the 'add' menu with 
browser:addMenuItem now. It requires the `title` attribute, even when 
you specify a factory:

<browser:addMenuItem
     title="The label that'll appear in the menu"
     factory="explicit.factory.id-or-dotted.name.of.the.class"
     />

Note that we rarely use factories from class (<content><factory 
/></content). They are only useful for zapi.createObject(). For the add 
menu, you can just do:

<browser:addMenuItem
     title="The label that'll appear in the menu"
     class="dotted.name.of.the.class"
     />

Philipp



More information about the Zope3-users mailing list