|
Cookbook /
TrailMenuSummary: Build an expanding menu from a trail
Version:
Prerequisites: pmwiki-2.0.0
Status:
Maintainer: Pm
Categories: Menus, WikiTrails
Votes:
Questions answered by this recipe!! QuestionIs it possible to build an expanding menu showing only those links related to the current page? AnswerThe trailmenu.phpΔ script allows an author to use a WikiTrail to build an editable, expanding navigation menu. It is based largely on the Cookbook-V1/Trail2Menu script authored by Niall Durham, but has been updated here to work with PmWiki 2.0. DiscussionThis script allows any WikiTrail to be used as the source for an expanding menu. For example, given a trail such as the following: * [[Cookbook]] ** [[Skins]] *** GeminiSkin *** LinesSkin *** LightSkin *** LeanSkin ** [[Cookbook#markup | Markups]] *** MarkupExtended *** EnableHTML *** PostItNotes ** [[Cookbook#menus | Menus]] *** TreeMenu *** TrailMenu *** TrackingMenu *** ExpandingMenu ** [[Cookbook#uploads | Uploads]] *** UploadTypes *** AttachLinks * [[PmWiki]] ** [[PmWiki/DocumentationIndex]] ** [[Installation]] the markup
Note that only those entries in the trail that are somehow related to the current page are displayed. ("Related" in this case means "direct descendents, direct ancestors, and ancestors' siblings".) This is just a first cut at this recipe, improvements and comments are welcome. InstallationTo use trailmenu.phpΔ, simply download it, copy it into the cookbook/ directory, and add Next, create a trail containing the page links to be displayed in the menu, using deeper levels of bullets to indicate submenus. Finally, use the markup Notes and CommentsThe original trailmenu does not work with pmwiki-2.2.x. Cause: In 2.2.x the Jjs 2007-01-06
I wish, someone would create a new type of menu, combining the advantages of TrailMenu and ExpandingMenu. As TrailMenu builds its list of menu items from a WikiTrail, no external urls or using headings is allowed. TrailMenu has the disadvantage of relying on building its menu items from WikiGroups - why should one have to create Groups only to be able to use them in a menu. Now a perfect menu would be called with a directive like Expanding Menu and thus still be able to build its item list from a simple unordererd list like TrailMenu, but not relying on the disadvantages of a WikiTrail. JK 2007-05-25
You may want to have a look at the brand new Cookbook.DynTrailMenu recipe.
Webbird 2008-08-31
See AlsoContributors
|