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 » dc_view

Log in
Name

Password

 
 


Dublin Core Elements

The Dublin Core metadata element set is a standard for cross-domain information resource description.
Element Description Value
Identifier resource ID http://old.zope.org/Members/struktur/MenuItem
Title resource name MenuItem provides a convenient way to generate and display dynamic navigation menus
Description resource summary <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- ================================================================================ --> <!-- This HTML file was created by AbiWord. --> <!-- AbiWord is a free, Open Source word processor. --> <!-- You may obtain more information about AbiWord at www.abisource.com --> <!-- ================================================================================ --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>/home/struktur/entwicklung/MenuItem/MenuItem Documentation.html</title> <style type="text/css"> body { font-family: "Times New Roman"; font-variant: normal; text-indent: 0in; widows: 2; font-style: normal; font-weight: normal; text-decoration: none; color: #000000; text-align: left; font-size: 12pt; font-stretch: normal; background-color: #ffffff; } @media print { body { padding-top: 0.9840in; padding-bottom: 0.7875in; padding-left: 0.9840in; padding-right: 0.9840in; } } </style> </head> <body><div> <p style="text-align: center; margin-top: 12pt"><span style="font-weight: bold; color:#000000; font-family: 'Arial'; font-size: 16,000000pt">MenuItem Documentation<br />(DRAFT)</span></p> <p style="text-align: center"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">By Simon Eisenmann </span><a href="mailto:[email protected]"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">[email protected]</span></a></p> <p style="text-align: center"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">Last update: Tuesday, 23 July 2002</span></p> <p style="text-align: left"><br /> </p> <ul class="Normal"> <li style="text-align: left"><span style="text-position: ; color:#000000; font-family: 'Times New Roman'; font-size: 12,000000pt">&nbsp;</span><span style="font-weight: bold; color:#000000; font-family: 'Arial'; font-size: 12,000000pt">What is MenuItem</span></li> </ul> <p style="text-align: left; margin-left: 36pt"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">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.</span></p> <p style="text-align: left"><br /> </p> <ul class="Normal"> <li style="text-align: left; margin-top: 6pt"><span style="font-weight: bold; text-position: ; color:#000000; font-family: 'Arial'; font-size: 12,000000pt">&nbsp;</span><span style="font-weight: bold; color:#000000; font-family: 'Arial'; font-size: 12,000000pt">How does it work</span></li> </ul> <p style="text-align: left; margin-left: 36pt"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">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.</span></p> <p style="text-align: left"><br /> </p> <ul class="Normal"> <li style="text-align: left; margin-top: 6pt"><span style="font-weight: bold; text-position: ; color:#000000; font-family: 'Arial'; font-size: 12,000000pt">&nbsp;</span><span style="font-weight: bold; color:#000000; font-family: 'Arial'; font-size: 12,000000pt">The menu rendering methods</span></li> </ul> <p style="text-align: left; margin-left: 36pt"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">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.</span></p> <p style="text-align: left; text-indent: -0.37cm"><br /> </p> <ul class="Normal"> <li style="text-align: left"><span style="text-position: ; color:#000000; font-family: 'Arial'; font-size: 10,000000pt">&nbsp;</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">The Methods</span></li> </ul> <p style="text-align: left"><br /> </p> <ul class="Normal"> <li style="text-align: left"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">def renderMenu( template, showParent, showHidden):</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"><br /><br />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.<br /></span></li> <li style="text-align: left"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">def renderSiteMap( template, showParent, showHidden):</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"><br /><br />This method returns the complete menu tree starting from the top which everything expanded. This is commonly called a sitemap.<br /></span></li> <li style="text-align: left"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">def renderSubLevel( template, showParent, showHidden):</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"><br /><br />This method renders the actual objects sub items.<br /></span></li> <li style="text-align: left"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">def renderOwnLevel( template, showParent, showHidden):</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"><br /><br />This method renders all items on the same menu levels as the current object. This would be the same as here.aq_parent.renderSubLevel.<br /></span></li> <li style="text-align: left"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">def renderMenuLevel( template, showParent, showHidden, level):</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"><br /><br />This method renders the requested menu level </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">level</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">.</span></li> </ul> </li> </ul> <p style="text-align: left"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"><br /></span></p> <ul class="Normal"> <li style="text-align: left"><span style="text-position: ; color:#000000; font-family: 'Arial'; font-size: 10,000000pt">&nbsp;</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">The parameters</span></li> </ul> <p style="text-align: left; margin-left: 36pt"><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">template<br /></span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">Takes the name or the object which should be used as MenuTemplate. If a string </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">test</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> would be given the id is computed as </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">menuTemplate_test</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">. (the </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">menuTemplate_ </span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">string is added in front). That object must be loadable in the current acquisition tree.</span></p> <p style="text-align: left; margin-left: 36pt"><br /> </p> <p style="text-align: left; margin-left: 36pt"><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">showParent<br /></span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">Takes </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">0</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> or </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">1</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> as integer value. Selects if the parent object should be displayed or not.</span></p> <p style="text-align: left; margin-left: 36pt"><br /> </p> <p style="text-align: left; margin-left: 36pt"><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">showHidden<br /></span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">Takes </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">0</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> or </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">1</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> as integer value. Selects if MenuItems with the </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">hidden</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> property should be displayed or not.</span></p> <p style="text-align: left; margin-left: 36pt"><br /> </p> <p style="text-align: left; margin-left: 36pt"><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">level<br /></span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">Defines as integer which menu level should be rendered. Only the </span><span style="color:#000000; font-family: 'Courier'; font-size: 10,000000pt">renderMenuLevel</span><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt"> method has this parameter.</span></p> <p style="text-align: left"><br /> </p> <ul class="Normal"> <li style="text-align: left; margin-top: 6pt"><span style="font-weight: bold; text-position: ; color:#000000; font-family: 'Arial'; font-size: 12,000000pt"> </span><span style="font-weight: bold; color:#000000; font-family: 'Arial'; font-size: 12,000000pt">The MenuTemplate</span></li> </ul> <p style="text-align: left; margin-left: 36pt"><span style="color:#000000; font-family: 'Arial'; font-size: 10,000000pt">To be written.</span></p> <p style="text-align: left"><br /> </p> <p style="text-align: left"><br /> </p> </div> </body> </html>
Creator resource creator ZopeOrgSite
Date default date 2002-08-01 05:21:51
Format resource format text/html
Type resource type Software Package
Subject resource keywords Navigational, Visual
Contributors resource collaborators
Language resource language
Publisher resource publisher No publisher
Rights resource copyright


Additional Zope Elements

Element Description Value
CreationDate date resource created 2002-08-01 05:21:51
ModificationDate date resource last modified 2002-08-01 05:21:51
EffectiveDate date resource becomes effective None
ExpirationDate date resource expires None

Backlinks: via Google / Technorati