MenuTreePlugin v. alpha 0.2#

--SteveTekell

Motivation#

I am considering using JspWiki as a lightweight CMS for web site. Maybe, you might think of JspWiki as Plone-light more than a Wiki in this case. With JspWiki templates you can get it looking nice, like a "real" web site not just a Wiki and with the upcoming auth* you can managed security more like a CMS than just a Wiki. Also, being able to disable auto-linking of CamelCase and use brackets with alternative display text is nice for more general web site development. So you have several features which make JspWiki possible for more than the usual Wiki functions. However, the big short coming for my requirements is the lack of good navigation. Of course, navigation (and site structure) is often a criticism of all Wikis. This plugin solves that problem.

What it does#

It provides a menu tree for use in the left menu. This is a custom tree defined in a Wiki page called "MenuTree" using nested bullets and links. This is not an attempt to auto-generate some huge messy graph out of all the constantly changing wiki links. A significant benefit over a plain left menu is that it expands and collapses to display the link for the current page. So you can have a large number of links in the menu without having to have them all displayed all the time. It also highlights the link for the current page and displays its children. Different CSS styles are used so that you can use images for open/closed folders as well as distinguish between nodes with children and leaf nodes.

Screen Shot#

A page called "TeamsAndWorkingGroups" is being displayed which corresponds to the link just called "Teams" in the menu.
MenuTreePlugin_ScreenShot.png

Installation#

Hey Nascif Abousalh Neto. Sounds interesting. But how do i implement it.

How it works#

The plugin is included in LeftMenu like this
[{INSERT org.ecoinformatics.seek.web.wiki.MenuTreePlugin }]

The data for the menu is maintained in a wiki page called "MenuTree". The example used in the screen shot was using this for MenuTree

*[SEEK-Home|Home]
*[About]
**[Components|SEEKComponents]
**[Contributors|SEEKContributors]
**[Teams|TeamsAndWorkingGroups]
***[EcoGrid|EcogridTeam]
***[Analysis & Modeling|AnalysisAndModelingTeam]
*[Education|EducationAndTraining]
**[EdTest1]
*[Documents]
**[DocTest1]
*[Community]
**[Test Link|Sandbox]
**[Test Link|Main]
*[Opportunities|Opportunities]
*[DataAndDataTools|SEEKToolsAndData]
**[ToolsTest1]

It currently only works for internal wiki links.

The plugin checks the latest version of MenuTree and refreshes the data structure when it changes.

The source code(info) is attached. Like I said, this is really just a rough proof of concept for now, so I haven't even bothered with a Jar file install. It's just the source files and a sample.css showing you the classes used (although I still haven't got list styles with images which work well across browsers).

Future Possibilities#

  • add some params to the plugin to generate different output for use in places outside of the left menu.
    • instead of the tree, display the path horizontally (similar to breadcrumbs), e.g. Top Page > Child Page > Current Page
    • option to do display only the ancestors and descendents of the current page. Currently all top level nodes are always shown which is appropriate for a menu, but not if you were just wanting to show related pages by including the plugin in the current page rather than the left menu it would be in appropriate.
  • I am considering developing a version which has a set of top-level tabs and have the left menu be the submenu of the current tab.

--SteveTekell

I attached a ready-to-drop .jar(info) file. In Windows, the plugin seems to work best under IE; the images don't work on Mozilla Firefox; and the images don't work and the list items are not aligned properly under Opera 7.53. Other then that, it works fine. Very nice plugin!

-- NascifAbousalhNeto


Bugs #

An </a> is needed at the end of each href.

Menu Tree Plugin Discussion#

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
jar
MenuTree.jar 4.1 kB 1 27-Jul-2004 16:28 149.173.6.51
zip
MenuTreePlugin.zip 5.0 kB 2 19-May-2004 20:50 STekell
gif
MenuTreePlugin_ScreenShot.gif 11.0 kB 1 19-Mar-2004 23:27 129.24.70.221
png
MenuTreePlugin_ScreenShot.png 12.5 kB 1 19-Mar-2004 23:32 129.24.70.221
« This page (revision-17) was last changed on 21-Jan-2009 05:46 by Kevin Yuen