]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/a_navbar_based_on_page_properties.mdwn
Merge branch 'master' of ssh://git.kitenet.net/srv/git/ikiwiki.info
[ikiwiki.git] / 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     \[[!navbaritem navbar=main priority=3]]
11     \[[!navbaritem navbar=main priority=5]]
12     \[[!navbaritem navbar=main title="Something else"]]
13     \[[!navbaritem navbar=main]]
14
15 then one could insert `\[[!navbar id=main maxlevels=0]]` somewhere and it
16 would get replaced with (this being in the context of viewing page C):
17
18     <ol class="navbar" id="navbar_main">
19       <li><a href="../B">B</a></li>
20       <li><a href="../A">A</a>
21         <ol>
22           <li class="current">Something else</li>
23           <li><a href="D">D</a></li>
24         </ol>
25       </li>
26     </ol>
27
28 B would sort before A because it has a higher priority, but C would sort
29 before D because their priorities are equal. The overridden title is not used
30 for sorting.
31
32 Also, the code automatically deduces that C and D are second-level under A.
33
34 I don't think this is hard to code up and it's what I've been using with
35 [rest2web](http://www.voidspace.org.uk/python/rest2web/) and it's served me
36 well.
37
38 --[[madduck]]
39 [[!tag wishlist]]