]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/toggle.mdwn
Merge commit 'upstream/master' into prv/po
[ikiwiki.git] / doc / ikiwiki / directive / toggle.mdwn
1 The `toggle` and `toggleable` directives are supplied by the [[!iki plugins/toggle desc=toggle]] plugin.
2
3 With these directives you can create links on pages that, when clicked, toggle
4 display of other parts of the page.
5
6 It uses javascript to accomplish this; browsers without javascript will
7 always see the full page content.
8
9 Example use:
10
11         \[[!toggle id="ipsum" text="show"]]
12
13         \[[!toggleable id="ipsum" text="""
14         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
15         eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
16         ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
17         aliquip ex ea commodo consequat.
18
19         [[!toggle id="ipsum" text="hide"]]
20         """]]
21
22 Note that you can include wiki markup in the toggleable text,
23 including even additional toggles, as shown in the above example.
24
25 Also, the toggle and the togglable definitions do not need to be next to
26 each other, but can be located anywhere on the page. There can also be
27 mutiple toggles that all toggle a single togglable.
28
29 The id has a default value of "default", so can be omitted in simple cases.
30
31 If you'd like a toggleable to be displayed by default, and toggle to
32 hidden, then pass a parameter "open=yes" when setting up the toggleable.
33
34 [[!meta robots="noindex, follow"]]