RE: [Zope3-Users] Menus

2007-02-20 Thread Roger Ineichen
Hi David

 Subject: [Zope3-Users] Menus
 
 I am curious what methods people use to implements simple web 
 site menus?  It seems to be this must be a common task.
 
 So far I've done this as follows:
 1. Create a skin
 2. Create a content type Menu as Ordered Container 3. Create 
 a content type MenuItem as contained by Menu 4. Add a Menu 
 and fill it with MenuItems 4. Register Menu 5. Create a macro 
 which returns the Menu using zapi.getUtility() 6. Use the 
 macro in the skin, and display all the MenuItems.

Take a look at the z3c package. We buil all our menus with
this concept. Even using the menu id pattern from Zope3 
is possible:

svn://svn.zope.org/repos/main/z3c.menu/trunk/src/z3c/menu/simple

Regards
Roger Ineichen
_
END OF MESSAGE

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Menus

2007-02-19 Thread David Johnson
I am curious what methods people use to implements simple web site  
menus?  It seems to be this must be a common task.


So far I've done this as follows:
1. Create a skin
2. Create a content type Menu as Ordered Container
3. Create a content type MenuItem as contained by Menu
4. Add a Menu and fill it with MenuItems
4. Register Menu
5. Create a macro which returns the Menu using zapi.getUtility()
6. Use the macro in the skin, and display all the MenuItems.

--
David


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Menus

2007-02-19 Thread Jim Washington

David Johnson wrote:
I am curious what methods people use to implements simple web site 
menus?  It seems to be this must be a common task.


So far I've done this as follows:
1. Create a skin
2. Create a content type Menu as Ordered Container
3. Create a content type MenuItem as contained by Menu
4. Add a Menu and fill it with MenuItems
4. Register Menu
5. Create a macro which returns the Menu using zapi.getUtility()
6. Use the macro in the skin, and display all the MenuItems.


Hi, David

You can do it that way.

I've been successful with the browser:menu... directives in zcml.  The 
following, as part of my browser/configure.zcml file, actually creates 
an IBrowserMenu utility with a name of myMenu.  I have another set of 
menuItems for the same menu for different interfaces, so the same named 
menu has different items at different parts of the site.


I find it handy to have this configuration in the same file where I 
configure the names of the pages.


!-- name the menu --
  browser:menu
   id=myMenu
   title=Main menu
/
   
!-- MAIN MENU --

browser:menuItems
   menu=myMenu
   for=..interfaces.IMainInterface
   
   browser:menuItem
   title=Main Page
   action=/index.html
   permission=zope.Public
   /

   browser:menuItem
   title=About Us
   action=aboutus.html
   permission=zope.Public
  /
/browser:menuItems

- Jim Washington
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users