You are not logged in Log in Join
You are here: Home » Members » struktur » MenuItem provides a convenient way to generate and display dynamic navigation menus

Log in
Name

Password

 
 

MenuItem provides a convenient way to generate and display dynamic navigation menus

/home/struktur/entwicklung/MenuItem/MenuItem Documentation.html

MenuItem Documentation
(DRAFT)

By Simon Eisenmann [email protected]

Last update: Tuesday, 23 July 2002


  •  What is MenuItem

MenuItem is a mix in zope object class, which can render dynamic menus. Each object represents one menu entry. MenuItem comes per default with one real useable object. This object is a MenuItem Folder or in shorts a MenuFolder. With this folder complex menu structures can be created easily in very short time. Just create some folder structure and you get the menu as well.


  •  How does it work

The MenuItem is catalogue based. That means there is a menu catalogue (ZCatalog), which holds all information of each MenuItem. Because of speed only the catalogue is accessed when a menu is rendered. Each MenuItem has several methods to display its own menu. These methods return a complete representation of the selected objects menu based on the current context as html. A PageTemplate is used to customize the layout of this html menu. These PageTemplates are called MenuTemplates. The MenuTemplates consist of one single part of the menu, which repeats itself for each MenuItem. Then a menu is rendered each MenuItem renders itself with the MenuTemplate, The MenuTemplate calls the render method again if the object has sub items. By this way the complete recursive menu tree can be rendered if wanted (e.g. for a sitemap). This can cause performance issues at very high load, so the output of the render methods is cacheable with zope caching mechanisms.


  •  The menu rendering methods

Each MenuItem comes with the following methods. Every single method returns a rendered html menu fragment. The output of the methods can be customized by certain parameters, which are described later in this document.


  •  The Methods


  • def renderMenu( template, showParent, showHidden):

    This method returns a common menu. Starting from the menu root, the tree is followed till the current MenuItem. The sub items of the current object are also show, so a complete navigation is possible. Use this method to create tree like menus.
  • def renderSiteMap( template, showParent, showHidden):

    This method returns the complete menu tree starting from the top which everything expanded. This is commonly called a sitemap.
  • def renderSubLevel( template, showParent, showHidden):

    This method renders the actual objects sub items.
  • def renderOwnLevel( template, showParent, showHidden):

    This method renders all items on the same menu levels as the current object. This would be the same as here.aq_parent.renderSubLevel.
  • def renderMenuLevel( template, showParent, showHidden, level):

    This method renders the requested menu level
    level.


  •  The parameters

template
Takes the name or the object which should be used as MenuTemplate. If a string test would be given the id is computed as menuTemplate_test. (the menuTemplate_ string is added in front). That object must be loadable in the current acquisition tree.


showParent
Takes 0 or 1 as integer value. Selects if the parent object should be displayed or not.


showHidden
Takes 0 or 1 as integer value. Selects if MenuItems with the hidden property should be displayed or not.


level
Defines as integer which menu level should be rendered. Only the renderMenuLevel method has this parameter.


  • The MenuTemplate

To be written.



Latest Release: 0.0.1
Last Updated: 2002-08-01 05:08:20
Author: ZopeOrgSite
Categories: Navigational, Visual
Maturity: Stable

Available Releases

Version Maturity Platform Released
0.0.1 Stable   2002-08-01 05:08:20
  MenuItem-0_0_1.tar.gz (13 K) All