]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/map/discussion.mdwn
Merge branch 'master' into cvs
[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 > [[bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used]] --[[Joey]] 
9
10 ----
11
12 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:
13
14  * This is the title meta information.
15
16    This is the description meta information
17
18  * This is another title.  
19
20    And so on ...
21
22 Is that possible?
23
24 --Peter
25
26 > the map directive could be made to use templates as the [[inline directive|ikiwiki/directive/inline]] does. (for the ambitious, the map functionality might even be special-cased into the inline plugin, i think) --[[chrysn]]
27
28 ----
29
30 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:
31
32  * all of the topics;
33  * all of the first-level subpages of the *current topic only*.
34
35 That is, if the current page is "Topic A" or "Topic A/Page 1", then the map should look like
36
37     Topic A
38         Page 1
39         Page 2
40         Page 3
41     Topic B
42     Topic C
43
44 but if the current page is "Topic B" or one of its subpages, then the map should look like
45
46     Topic A
47     Topic B
48         Page 1
49         Page 2
50         Page 3
51     Topic C
52
53 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.
54
55 Is there any way to do that?  I don't mind mucking around with `\[[!meta]]` on every page if that's what it takes.
56
57 -- Zack
58
59 > I think that you're looking for this:
60
61 > `pages="((Topic*/* or Topic*) and ./*) or (Topic* and ! Topic*/*)"`
62
63 > Let's pull that [[PageSpec]] apart. 
64
65 > * `(Topic*/* or Topic*)` matches all pages that are underneath a Topic
66 >    page or are a topic page themselves.
67 > * `and ./*` further adds the limitation that the pages have to be
68 >   in the same directory as the page that is displaying the map. So,
69 >   for `Topic_A/Page_1`, it will match `Topic_A/*`; for `Topic_A`,
70 >   it will match `Topic_*` but not subpages.
71 > * Finally, `Topic* and ! Topic*/*` matches all the toplevel topic pages,
72 >   since we always want those to show up.
73
74 > I haven't tested that this works or displays, but I hope it gets you
75 > on the right track. PS, be aware of
76 > [[this_sidebar_issue|todo/Post-compilation_inclusion_of_the_sidebar]]!
77 > --[[Joey]]
78
79 >> Thanks, but this assumes that topic pages are named `Topic<something>`.
80 >> They aren't.  They are tagged with `\[[!meta link="/topic"]]`, and as
81 >> far as I can tell there is no [[PageSpec]] notation for "subpages of a
82 >> page that satisfies link(foo)"...
83 >> -- Zack
84
85 >>> I think that the ideas and code in
86 >>> [[todo/tracking_bugs_with_dependencies]] might also handle this case.
87 >>> --[[Joey]]
88
89 ----
90
91 I feel like this should be obvious, but I can't figure out how to sort numerically. 
92
93 I have `map pages="./* and !*/Discussion and !*/sidebar"`  and a bunch of pages with names like 1, 2, 3, 11, 12, 1/1.1, 12/12.3 etc. I want to sort them numerically. I see lots of conversation implying there's a simple way to do it, but not how.
94
95 > No, you can't: map can't currently use a non-default sort order. If it
96 > could, then you could use [[plugins/sortnaturally]]. There's a
97 > [[feature_request|todo/sort_parameter_for_map_plugin_and_directive]];
98 > [[a_bug_references_it|bugs/map_sorts_by_pagename_and_not_title_when_show=title_is_used]].
99 > --[[smcv]]