[Zope3-Users] Re: Interface or adapter for AddMenuItems

Philipp von Weitershausen philipp at weitershausen.de
Tue Aug 8 18:37:55 EDT 2006

John Smith wrote:
> Hi,
> I have a content container object and I was wondering
> what is the easiest/best way to access the list of
> allowed content types which may be added to this
> container.
> Is there an interface to which I can adapt my object,
> or a menu service/utility?
> I looked in the page template code template.pt, but it
> looks as if the items in the add menu come in as some
> kind of html text string.
> Any help gratefully received,

Get the container's adding view:

  >>> adding = z.c.getMultiAdapter((obj, request), name='+')

and then iterate over the adding info:

  >>> for info in adding.addingInfo():
  ...     # do fun stuff with info here



More information about the Zope3-users mailing list