On Monday 21 March 2005 19:12, Florian Lindner wrote:
> could you provide a example of the use of a add menu? I'm trying here, but
> it won't work for me.
> I'm registering a menu:
> <menu id = "CSaddMenu" />
> tried also adding interface="*"

This makes no sense. Please read the documentation. The `interface` attribute 
in the menu directive allows you to specifically specify a menu interface, 
instead of having the directive create one for you.

> and a addMenuItem:
>     <addMenuItem
>         title="Title of addMenuItem Link"
>         view="AddCSLink.html"
>         class="CS.Linklist.link.Link"
>         permission="zope.Public"
>         menu="CSaddMenu"
>     />
> tried also adding for="*"

You definitely do not want to do this.

> Now I'm trying to use this CSaddMenu in a ZPT (view on a folder):
> <ul>
> <li tal:repeat="addItem context/@@view_get_menu/CSaddMenu">[ <a
> tal:attributes="href addItem/action"
> tal:content="addItem/title">addItem</a> ]</li>
> </ul>
> But this return a empty list.
> How is it used correctly?

It all depends on what the context is. If context is an object providing 
`IAdding`, you should definitely get a menu item.

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-users mailing list

Reply via email to