]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/toggle.mdwn
fd3e935dab041d50a602eb92c7ef09ee189196e0
[ikiwiki.git] / doc / plugins / toggle.mdwn
1 [[template id=plugin name=toggle author="[[Joey]]"]]
2 [[tag type/chrome]]
3
4 With this plugin you can create links on pages that, when clicked, toggle
5 display of other parts of the page.
6
7 It uses javascript to accomplish this; browsers without javascript will
8 always see the full page content.
9
10 Example use:
11
12         \[[toggle id="ipsum" text="show"]]
13
14         \[[toggleable id="ipsum" text="""
15         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
16         eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
17         ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
18         aliquip ex ea commodo consequat.
19
20         [[toggle id="ipsum" text="hide"]]
21         """]]
22
23 Clicking on "more" will toggle the display of the togglable text.
24
25 Note that you can include wiki markup in the toggleable text,
26 including even additional toggles, as shown in the above example.
27
28 Also, the toggle and the togglable definitions do not need to be next to
29 each other, but can be located anywhere on the page. There can also be
30 mutiple toggles that all toggle a single togglable.
31
32 The id has a default value of "default", so can be omitted in simple cases.