|
Trail2Menu<< Wiki Farm | Cookbook-V1 | Drop Down Menu >> Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
GoalA wiki-editable, expanding navigation menu. This module converts a Wiki Trail page into an expanding side-menu allowing one to organize wiki pages into a free-form hierarchal structure (at least for navigation purposes). Includes an associated bread crumb trail function. SolutionDownload the files: Attach:t2m-0.1.tgz The archive will unpack into a directory named t2m-0.1/. Copy this directory and its contents into your local/ subdirectory. Add the following line to your config.php file: include_once('local/t2m-0.1/t2m-config.php');
Look at the t2m-config.php file for some variables that you can configure for your specific installation. I'll assume the default settings are in place for the following instructions. Because of the way I'm producing the output, you have to make separate wiki pages for the side menu and breadcrumb trail. On the trail2menu test site I just modified the default pmwiki template (minimal). The first thing is to setup a wiki page that will hold the side menu (Main.SideBar in this example). Here's the source of the trail2menu test site side menu. You will also need a page to hold the wiki trail that describes the site structure. I have mine stored in Main.SiteTrail. Check out the source of the trail2menu site trail. Note that this is the page you edit when you click on the edit link in the side menu. If you want a breadcrumb output, you will need to make a separate breadcrumb page (Main.BreadCrumb in my example). See the source. Exciting stuff, isn't it? I included the above wiki page (Main.BreadCrumb) in my HTML template to make sure it was available on every page. Finally, if you want to have a diagnostic output page (helps if you have a lot of wiki pages you're trying to put/keep in the menu), you will need a page to dump the trail information. I named mine Main.DumpTrail. On the diagnostic page, you can control whether or not it lists unlinked files in the wiki.d/ directory via the $TrailMenuDumpAllPages variable. Its likely that I have gaps in my instructions. Comments and/or suggestions welcome. DiscussionCheck out the trail2menu test site to see if you might find it helpful. Feel free to modify the menu and add pages to the site to see what it can do. An alternative way may be Cookbook/OrGrSkin. I use this on http://www.wikiwiki.de. MaWo See AlsoUm, maybe something on Wiki Trail markup? Also link to instructions on including a wiki page from the HTML template (breadcrumb). History
Comments & BugsComments by Wooshoofoo:
include_once("local/t2m-0.1/trail2menu.php"); Comments by Henning:
Contributors
CopyrightCopyright 2004 Niall Durham. Released under GPL. pmwiki-2.2.0-beta68 -- Last modified by {{}}?
|