web commit by http://madduck.net/: tagging wishlist
[ikiwiki] / doc / todo / a_navbar_based_on_page_properties.mdwn
1 One thing I don't like about Tobi's `navbar.pm` is that the navigation bar is
2 hardcoded instead of computed from what's available. Obviously, this allows
3 for a very customised `navbar` (i.e. not making all pages show up, like
4 a `map` would). However, I think this could also be achieved through page
5 properties.
6
7 So imagine four pages A, B, A/C, and A/D, and these pages would include the
8 following directives, respectively
9
10     \[[navbar id=main priority=3]]
11     \[[navbar id=main priority=5]]
12     \[[navbar id=main title="Something else"]]
13     \[[navbar id=main]]
14
15 then the computed navigation bar would be
16
17     B
18     A
19       Something else
20       D
21
22 B would sort before A because it has a higher priority, but C would sort
23 before D because their priorities are equal. The overridden title is not used
24 for sorting.
25
26 Also, the code automatically deduces that C and D are second-level under A.
27
28 I don't think this is hard to code up and it's what I've been using with
29 [rest2web](http://www.voidspace.org.uk/python/rest2web/) and it's served me
30 well.
31
32 --[[madduck]]
33 [[!tag wishlist]]