Navitree
Description
Create a navigation list of the tree of subpages for any page in an indented bulleted list layout.
Download & Release Notes
Download |
Release Version |
Moin Version |
Release Notes |
|
1.5 |
|
Usage
This macro is based off of Navigation.py. Like Navigation, it creates a navigation list of links for all subpages of a page, with optional depth limiting.
The difference is that the links are displayed as an indented bulleted list, like an outline. This way, a user can see the "hierarchy" of the navigation tree as it exists in the wiki. Names displayed are simplified (i.e. just the page name) since the "path" is displayed via the hierarchy itself.
Currently there is only one function, "childtree", which creates the navigation list of links for the tree of child subpages. It has the same structure as Navigation.py, so other functions can be added easily (e.g. siblingtree). Depth can be limited as mentioned, e.g. Navitree(childtree, 1).
So, for example, if you had wiki pages Page1, Page1/Child1, Page1/Child1/Grandchild1, Page2, and Page2/Child2, the results of Navitree(childtree) used on Page1 would look like this:
- Page1
- Child1
- Grandchild1
- Child1
- Page2
- Child2
Copyright
JenniferVanderputten - <Jen AT rabidweasel DOT com>
License
Bugs
Discussion
I needed the same kind of functionality but wanted to be able to specify the page name instead of using the current page name.
The Navitree-GunnarWrobel.py provides a small extension that allows using Navitree(selectedtree,PageName,depth).
Hope adding this as an attachment to this page is the correct way of providing updates to macros.
Hey Gunnar, this change doesn't work for me on my MoinMoin installation. The problem appears to be the method used to get the child pages. It is always based off of the current page via the request object. I was able to tell the request object to use a different root page, but it gave an error message saying that functionality wasn't yet implemented. I am running version 1.5.3, is there a later version that this works for?
Strange, I am running 1.5.2 here. I guess I should try to upgrade to 1.5.3 and retest the macro there. I'll report back once I did that.
FYI... I'm running 1.5.2, and your enhancement does not work for me either. It always displays relative to the current page, no matter what page I specify. My syntax is [[Navitree(childtree,FTS,5)]] -- SteveDavison 2007-01-26 11:36:43
Ok, I had to update to 1.5.4 since this is the only unstable version we have available on Gentoo at the moment. But the macro works fine there. Could you post some details on the error? Maybe I can figure out what the problem is. I am using the macro on the frontpage of http://doc.pardus.de (site is in german though).
I'll try it again when we upgrade to 1.5.4. It might be a version issue.
Great!! That's what i have been looking for.
--dor
( Hmm.. It does "?action=content", but cannot proceed "?action=print"; but i wish it could. --dor )
( Hmm.. It inserts unclosed <UL> if there are no children... It seems... --dor )
I'll take a look at both of those items, thanks for the information -- JenniferVanderputten
Cool! Is there a way to use the first heading in the page as tree items in stead of using the page name? and use page name when there is no heading in the page? --Jingshao
Currently no, but anyone is welcome to add a new function that does that. The beauty of open source! --JenniferVanderputten