]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/conditional/discussion.mdwn
response
[ikiwiki.git] / doc / plugins / conditional / discussion.mdwn
1 ## Conditional broken?
2
3 Using \[\[!if test="tagged(plugin)" then="= Tagged as plugin =" else="*No plugins found*"]] on this wiki *should* present the 'Tagged as plugin' heading, instead it emits 'no plugins found'. Is the conditional plugin currently broken for tags or am I misusing it? Thanks.
4
5 -- Thiana
6
7 > This wiki has no page named "plugin", so nothing links to it; tags are a species of link
8 > so tagging a large number of pages with a tag that doesn't exist (which change has
9 > been reverted) doesn't make the pagespec match. It would if the tag's page existed. --[[Joey]]
10
11 ----
12
13 Would there be a way for this plugin to emit fewer blank lines (i.e. *none at all*)?
14
15 For example, having a look at [this page](http://www.bddebian.com/~wiki/Hurd/)'s sidebar.
16 This [sidebar](http://www.bddebian.com/~wiki/sidebar/)
17 ([source code](http://www.bddebian.com/gitweb/?p=wiki;a=blob_plain;f=sidebar.mdwn))
18 is supposed to have *no* blank lines between...
19
20 * **Hurd** and *About*,
21 * *Todo* and **Mach**,
22 * **Mach** and **Mig**.
23
24 --[[tschwinge]]
25
26 > The blank lines in this example are coming from the newline after `then="`, and also from the newline before the close quote. If you remove those newlines, I think it should work. --[[Joey]]
27
28 >> No, that's unfortunately not it, see here:
29 >> [[!if test="enabled(trallala)" then="foot"]]
30 >> Continued.  But on the other
31 >> [[!if test="enabled(trallala)" then="foot" else="hand:"]]
32 >> Continued.  --[[tschwinge]]
33
34 >>> Seems ok, no? The only linebreaks I see in the source are the ones you
35 >>> put at the end of the lines. --[[Joey]]
36
37 >>>> Okay, that would explain the linebreak between 1 and 3.  But then, why are all linebreaks removed between 3 and 5?
38
39 >>>> 1 No, that's unfortunately not it, see here:
40 >>>> [[!if test="enabled(trallala)" then="foot"]]
41 >>>> 3 Continued.  But on the other
42 >>>> [[!if test="enabled(trallala)" then="foot" else="hand:"]]
43 >>>> 5 Continued.  --[[tschwinge]]
44
45 >>>>> The conditional after 1 evaluates to "", so there's a blank line
46 >>>>> there. The one after 3 evaluates to "hand:", so no blank line there.
47 >>>>> --[[Joey]]
48
49 I have a sidebar that contains
50 <pre>
51   #### Archives
52
53   \[[!calendar type="year" months_per_row="6"  pages="blog/* and !*/Discussion"]]
54   \[[!calendar type="month" pages="blog/* and !*/Discussion"]]
55   &lt;h4&gt;Indices&lt;/h4&gt
56   \[[!map pages="archives/* and !*/Discussion"]]
57 </pre>
58 I am trying to make it so that the archives and index only show up if the destpage is either blog/* or / -- the top of the wiki. Unfortunately, I don't think I am getting the
59 conditional right -- I have a "]] left over at the end (looking at the rendered html). Ideally, I would like to be able to do todays calendar on the top level pagel and 
60 the annual calendar on archives/200[4567].mdwn, and monthly calendars for the proper month on archives/200[4567]/[0..12].mdwn. Do I have to create separate sidebars?
61 I do not use the usedir directive, so all my annual archive pages live in archives/, and all my monthly archive pages live in, say, archives/2007/ --ManojSrivastava
62
63 > Are you using triple quoting for the text in the conditional? --[[Joey]]