MenuItem Documentation
(DRAFT)

By Simon Eisenmann simon@struktur.de

Last update: Tuesday, 23 July 2002


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.


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.


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.




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.


To be written.