[Zope3-Users] menus

Florian Lindner mailinglists at xgm.de
Fri Feb 25 12:37:49 EST 2005


Am Freitag, 25. Februar 2005 06:31 schrieben Sie:
> Florian Lindner wrote:
> >Am Mittwoch, 23. Februar 2005 09:56 schrieb Florian Lindner:
> >>Hello,
> >>I try to use menus.
> >
> >[...]
> >
> >Please help... or is this a FAQ?
>
> Everything looks ok in your example and a similar example is running on
> my machine.  I can't find the mistake...
> - A problem might be the order of registration

> - Do you go with the current trunk?

revision 29296. Completely new checked out and compiled. Created new instance.

order:


<configure xmlns="http://namespaces.zope.org/zope">
 <include package=".skin" /> 
    <include package=".Linklist" />
</configure>

.skin configure.zcml:


<configure xmlns="http://namespaces.zope.org/browser">
 <layer name="centershock"/>
 <skin name="centershock" layers="centershock rotterdam default" />

 <resource name="styles.css" file="styles.css" layer="centershock" /> 

 <page
  for="*"
  name="standard_macros"
  permission="zope.Public"
  class=".standardmacros.StandardMacros"
  layer="centershock"
  allowed_interface="zope.interface.common.mapping.IItemMapping" 
 />

 <page 
  for="*"
  name="skin_macros"
  permission="zope.Public"
  layer="centershock"
       template="template.pt" 
 />
    
    
    <menu
        description="Nav Items"
        id="navMenu"
        title="Nav Items on the left"
    />
    
</configure>


template.pt uses the navMenu:

 <li tal:repeat="navItem context/@@view_get_menu/navMenu"> <a 
tal:attributes="href navItem/action" 
tal:content="navItem/title">navItem</a></li>


.Linklist.browser.skin configure.zcml:

<configure xmlns="http://namespaces.zope.org/browser">

 <page
        name="folderlisting.html"
  for="CS.Linklist.interfaces.ILinkFolder"
  template="folderlisting.pt"
        permission="zope.View"
        layer="centershock"        
 />
    
    <defaultView
        for="CS.Linklist.interfaces.ILinkFolder"
        name="folderlisting.html"
    />
    
    <page
        name="link.html"
        for="CS.Linklist.interfaces.ILink"
        class=".link.Link"
        template="link.pt"
        permission="zope.View"
        layer="centershock"
        allowed_interface="CS.Linklist.interfaces.ILinkFolder"
        menu="navMenu"
        title="E"
    />
    
    <defaultView
        for="CS.Linklist.interfaces.ILink"
        name="link.html"
    />
    
    <addform
        label="Add CSLink"
        title="Add CSLink title"
        name="AddCSLink.html"
        schema="CS.Linklist.interfaces.ILink"
        content_factory="CS.Linklist.link.Link"
        permission="zope.View"
        layer="centershock"
        menu="navMenu"
    /> 

</configure>

link.html and AddCSLink.html use the page macro defined in .skin.template.pt.


You see anything wrong?


Thanks,

Florian


More information about the Zope3-users mailing list