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