Description of a Macro, which shows a moin-page as a hierachical tree-structure
Tell your story here:
A macro shows a unordered list as a folder-structure.
Let us look on an example:
PageOnFirstLevel -- Maybe this is an important portal
- !ThisIsASecondLevelPage -- Not a portal, only a page
- !ThisIsASecondLevelPage -- Not a portal, only a page
- !ThisIsASecondLevelPage -- Subportal with a number of pages
- !ThisIsAThirdLevelPage -- Normal page
- !ThisIsAThirdLevelPage -- Normal page
- !ThisIsASecondLevelPage -- Not a portal, only a page
AnotherPageOnFirstLevel -- Another important portal
OtherSecondLevelPages -- a page
OtherSecondLevelPages -- a page
What is the problem you are trying to solve?
Since I work with MoinMoin (Jan. 2003), I often thougt, that I need a system to organize my own informations:
- Links to the Internet, links to other wikis,
- My own Pages
- Pages of other users from our company-wiki
So this macro should offer a collapsed view of the tree-structure and it should offer two types of links:
- Klicking to the links on the folders: it expands the content of the folder to the next level and shows folders or page-links
- Klicking to the links from a page: it jumps to the page, representet by its name
The goal is, to present menu-like-structures in a tree, expanding or collapsing, as the user needs it.
From were does it comes the information to make this tree? Is local (from the page only) or it should represent a wiki seudo-hierarquical view? Please check FacetedClassificationInMoin, FacetBrowsingTheme.
(Picture should follow)
should it be something like this (While it is not wiki javascripts needs to be enabled): http://www.fz-juelich.de/vislab/software/idl_samples/IDL-Beispielsammlung.html and should it always show the structure as in the left frame and probably the wiki page on the right one. Probably it could be a fine extension to the right or left side bar themes. -- ReimarBauer 2005-10-17 20:52:21
- This would be a very nice option:
- I really prefer leftsidebar-themes (in my company i'm using the old leftsidebar-theme for MM124, at home for MM1.3x I use monobook, workin' on an adaption from sinorca4moin and one other leftsided theme...).
I adopted some Features for the aktual MM-Version (1.3-tree) to the old MM124-Version, like search-box at the top of the page and some others. So the leftsidebar is the central position to insert a menu like the tree-menu you build for the page at fz-juelich.de (see link above).
I think, the tree must be configurable and must also be context-sensitive.
May be, we need an action, to make a tree inside a page becoming a tree at the left-side-barBut on the other Hand i think, Nirs idea was really good too: Maybe a parser was good too, to show several views of a page.. -- KlausHeinisch 2005-10-19 00:37:41
Discussion
I wanted something similar and had worked up a search macro that would find all sub-pages. Because of the confusing time I had trying to program a macro, I posted the question to TimCera and NirSoffer responded with a 4 line macro. A much cleaner implementation than mine. You probably want something with a little more polish, just mentioning here because I thought of a similar need. Adding indenting would be nice. -- TimCera 2005-10-14 13:10:34
Maybe that this looks similar to the well known action "LocalSiteMap", which builds a TreeStructure too. But the Tree-Hierarchy depends on all Links, which are placed on the page and the second level of the tree was builded from the links on the pages from the first page. If you want to build a complete menu, you have to write many menu-pages.
With this Macro (or maybe Action), users will be able to build menus with one page, making a central point for many subjects or building special topic-portals. -- KlausHeinisch 2005-10-14 19:25:36
Here is possible solution, I hope this is what you mean:
You create an expandable tree view on a page with a tree parser:
- First branch - [http://www.example.com/ External Link Leaf] - LocalWikiPageLeaf + Second branch + Sub branch + LocalWikiPageLeaf
+ mark a collapsed list
- mark an expanded list
- a branch can be text
- leaf can be a wiki link
In the examples bellow, I use * to create lists, the final list will not have a bullet.
This parser will render the tree as a list which can be expanded and collapsed:
- - First branch
- + Second branch
When clicking on a branch it is expanded one level:
- - First branch
- - Second branch
- + Sub branch
When clicking on a + or -, the branch is expanded all levels:
- - First branch
- - Second branch
- - Sub branch
If you want to have the same tree on many pages, you put it on a page and include the page in the other pages.
Very nice Idea, Nir. How must this be implemented? Any idea? -- KlausHeinisch 2005-10-19 00:37:41
- It can be done in two ways:
- add the + syntax to the wiki parser, and then you can have those lists in a regular page.
- Create a minimal parser that use the standard * or 1. format, reusing code from the wiki parser, but treat them as collapsible lists.
I think that javascript code here is what needed.
- It can be done in two ways:
I did some experimental tree navigation by enhancing the rightsidebar theme quite some time ago, see ThemeArchiveMarket. Recently I refactored this solution using an action LocalSiteTree (derived from LocalSiteMap) and patched it into the monomoin theme. See screenshot. Very easy to implement in themes that use the metaphor of navigation panels. It makes a difference between subpages and other related pages and have configured the action to suppress underlay pages and check for depth and node count limits. If anyone is interested I can provide code and someone can polish it from the usability point of view, integrate moin theme config so you can switch off panels etc, which I will not be able to do soon. -- RobertSeeger 2005-10-26 23:37:03