]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/map/discussion.mdwn
response
[ikiwiki.git] / doc / ikiwiki / directive / map / discussion.mdwn
1 Question: Is there a way to generate a listing that shows *both* title and description meta information? Currently, a \[\[!map ...]] shows only one of the two, but I'd like to generate a navigation that looks like a description list. For example:
2
3  * This is the title meta information.
4
5    This is the description meta information
6
7  * This is another title.  
8
9    And so on ...
10
11 Is that possible?
12
13 --Peter
14
15 ----
16
17 The site I'm trying to set up right now (not really a wiki - no public editing) is divided into topics.  Topics are pages that have `\[[!meta link="/topic"]]`.  Topic pages contain an index of their subpages (done with `\[[!inline]]`); the subpages are the real content.  I want a map in the sidebar that lists:
18
19  * all of the topics;
20  * all of the first-level subpages of the *current topic only*.
21
22 That is, if the current page is "Topic A" or "Topic A/Page 1", then the map should look like
23
24     Topic A
25         Page 1
26         Page 2
27         Page 3
28     Topic B
29     Topic C
30
31 but if the current page is "Topic B" or one of its subpages, then the map should look like
32
33     Topic A
34     Topic B
35         Page 1
36         Page 2
37         Page 3
38     Topic C
39
40 On the top-level index page, or on any other page that is neither a topic nor a subpage of a topic, the map should list only the topics.
41
42 Is there any way to do that?  I don't mind mucking around with `\[[!meta]]` on every page if that's what it takes.
43
44 -- Zack
45
46 > I think that you're looking for this:
47
48 > `pages="((Topic*/* or Topic*) and ./*) or (Topic* and ! Topic*/*)"`
49
50 > Let's pull that [[PageSpec]] apart. 
51
52 > * `(Topic*/* or Topic*)` matches all pages that are underneath a Topic
53 >    page or are a topic page themselves.
54 > * `and ./*` further adds the limitation that the pages have to be
55 >   in the same directory as the page that is displaying the map. So,
56 >   for `Topic_A/Page_1`, it will match `Topic_A/*`; for `Topic_A`,
57 >   it will match `Topic_*` but not subpages.
58 > * Finally, `Topic* and ! Topic*/*` matches all the toplevel topic pages,
59 >   since we always want those to show up.
60
61 > I haven't tested that this works or displays, but I hope it gets you
62 > on the right track. PS, be aware of
63 > [[this_sidebar_issue|todo/Post-compilation_inclusion_of_the_sidebar]]!
64 > --[[Joey]]
65
66 >> Thanks, but this assumes that topic pages are named `Topic<something>`.
67 >> They aren't.  They are tagged with `\[[!meta link="/topic"]]`, and as
68 >> far as I can tell there is no [[PageSpec]] notation for "subpages of a
69 >> page that satisfies link(foo)"...
70 >> -- Zack
71
72 >>> I think that the ideas and code in
73 >>> [[todo/tracking_bugs_with_dependencies]] might also handle this case.
74 >>> --[[Joey]]