]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/map/discussion.mdwn
(no commit message)
[ikiwiki.git] / doc / ikiwiki / directive / map / discussion.mdwn
1 ### Sorting
2
3 Is there a way to have the generated maps sorted by *title* instead of *filename* when show=title is used?
4 Thanks 
5
6 -- Thiana
7
8 ----
9
10 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:
11
12  * This is the title meta information.
13
14    This is the description meta information
15
16  * This is another title.  
17
18    And so on ...
19
20 Is that possible?
21
22 --Peter
23
24 ----
25
26 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:
27
28  * all of the topics;
29  * all of the first-level subpages of the *current topic only*.
30
31 That is, if the current page is "Topic A" or "Topic A/Page 1", then the map should look like
32
33     Topic A
34         Page 1
35         Page 2
36         Page 3
37     Topic B
38     Topic C
39
40 but if the current page is "Topic B" or one of its subpages, then the map should look like
41
42     Topic A
43     Topic B
44         Page 1
45         Page 2
46         Page 3
47     Topic C
48
49 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.
50
51 Is there any way to do that?  I don't mind mucking around with `\[[!meta]]` on every page if that's what it takes.
52
53 -- Zack
54
55 > I think that you're looking for this:
56
57 > `pages="((Topic*/* or Topic*) and ./*) or (Topic* and ! Topic*/*)"`
58
59 > Let's pull that [[PageSpec]] apart. 
60
61 > * `(Topic*/* or Topic*)` matches all pages that are underneath a Topic
62 >    page or are a topic page themselves.
63 > * `and ./*` further adds the limitation that the pages have to be
64 >   in the same directory as the page that is displaying the map. So,
65 >   for `Topic_A/Page_1`, it will match `Topic_A/*`; for `Topic_A`,
66 >   it will match `Topic_*` but not subpages.
67 > * Finally, `Topic* and ! Topic*/*` matches all the toplevel topic pages,
68 >   since we always want those to show up.
69
70 > I haven't tested that this works or displays, but I hope it gets you
71 > on the right track. PS, be aware of
72 > [[this_sidebar_issue|todo/Post-compilation_inclusion_of_the_sidebar]]!
73 > --[[Joey]]
74
75 >> Thanks, but this assumes that topic pages are named `Topic<something>`.
76 >> They aren't.  They are tagged with `\[[!meta link="/topic"]]`, and as
77 >> far as I can tell there is no [[PageSpec]] notation for "subpages of a
78 >> page that satisfies link(foo)"...
79 >> -- Zack
80
81 >>> I think that the ideas and code in
82 >>> [[todo/tracking_bugs_with_dependencies]] might also handle this case.
83 >>> --[[Joey]]