Try this:
First, create a tiddler, "ToggleTiddler", tagged with $:/tags/Macro, containing:
\define toggle(title)
<$vars toggle_id=<<qualify "$:/state/toggle/$title$">>>
<$reveal state=<<toggle_id>> type="nomatch" text="show">
<$button class="tc-btn-invisible" set=<<toggle_id>> setTo="show">
<$text text="""$title$"""/> {{$:/core/images/right-arrow}}
</$button>
</$reveal>
<$reveal state=<<toggle_id>> type="match" text="show">
<$button class="tc-btn-invisible" set=<<toggle_id>> setTo="hide">
<$text text="""$title$"""/> {{$:/core/images/down-arrow}}
</$button>
<$transclude tiddler="""$title$""" mode="block"/>
</$reveal>
\end
Then, in any other tiddler, you can use it like this:
<<toggle "NameOfTiddler">>
Notes:
* The $vars constructs a "state tiddler" title that incorporates the target tiddler title. The state tiddler keeps track of whether the content is shown or hidden.
* <<qualify "...">> is used to ensure that each use of the toggle macro is unique
* The first $reveal displays a $button when the target tiddler content is not being shown
* The $button then sets the state tiddler's value to "show"
* The $button uses class="tc-btn-invisible" so that it appears as normal text (i.e., without the usual button appearance)
* The $button label displays the title of the target tiddler followed by the right-arrow image
* The second $reveal does the opposite of the first $reveal (i.e., displays a $button that sets the state value to "hide", and uses the down-arrow image)
* The second $reveal also $transcludes the target tiddler content
References:
enjoy,
-e