aboutsummaryrefslogtreecommitdiff
path: root/doc/todo/a_navbar_based_on_page_properties.mdwn
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2008-03-18 10:25:45 -0400
committerJoey Hess <joey@kitenet.net>2008-03-18 10:25:45 -0400
commit99f9e54ca71420fe42d9130184df23ad044a9595 (patch)
treed53c4bf8e1a3e0f938033fe22f64e37e6cafb813 /doc/todo/a_navbar_based_on_page_properties.mdwn
parentbc96a06b992213d9e09ec8ec6fb6f028e53791bd (diff)
downloadikiwiki-99f9e54ca71420fe42d9130184df23ad044a9595.tar
ikiwiki-99f9e54ca71420fe42d9130184df23ad044a9595.tar.gz
web commit by http://madduck.net/: more details
Diffstat (limited to 'doc/todo/a_navbar_based_on_page_properties.mdwn')
-rw-r--r--doc/todo/a_navbar_based_on_page_properties.mdwn30
1 files changed, 17 insertions, 13 deletions
diff --git a/doc/todo/a_navbar_based_on_page_properties.mdwn b/doc/todo/a_navbar_based_on_page_properties.mdwn
index 7300aced2..f88a3e802 100644
--- a/doc/todo/a_navbar_based_on_page_properties.mdwn
+++ b/doc/todo/a_navbar_based_on_page_properties.mdwn
@@ -7,17 +7,23 @@ 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
+ \[[!navbaritem navbar=main priority=3]]
+ \[[!navbaritem navbar=main priority=5]]
+ \[[!navbaritem navbar=main title="Something else"]]
+ \[[!navbaritem navbar=main]]
+
+then one could insert `\[[!navbar id=main maxlevels=0]]` somewhere and it
+would get replaced with (this being in the context of viewing page C):
+
+ <ol class="navbar" id="navbar_main">
+ <li><a href="../B">B</a></li>
+ <li><a href="../A">A</a>
+ <ol>
+ <li class="current">Something else</li>
+ <li><a href="D">D</a></li>
+ </ol>
+ </li>
+ </ol>
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
@@ -25,8 +31,6 @@ for sorting.
Also, the code automatically deduces that C and D are second-level under A.
-Obviously, while on e.g. A/C, the `<li>` element enclosing C would get a special CSS class (or even ID), and no `<a>` tag inside.
-
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.