OK, I have now got a version that actually works (slimmed down version -
mine uses FontAwesome icons and has an edit-from-controller link, too)
\define fold(content)
<$set name="controller" value={{{ [[$:/state/]addsuffix<currentTiddler>
addsuffix[/fold/]addsuffix<content>] }}}>
<$reveal type="nomatch" state=<<controller>> text="open">
<$button class="tc-btn-invisible" set=<<controller>> setTo="open">
<$transclude tiddler="$content$" field="caption" /> (closed)
</$button>
</$reveal>
<$reveal type="match" state=<<controller>> text="open">
<$button class="tc-btn-invisible" set=<<controller>> setTo="close">
<$transclude tiddler="$content$" field="caption" /> (open)
</$button>
</$reveal>
<$reveal type="match" state=<<controller>> text="open">
<$transclude tiddler="$content$" />
</$reveal>
</$set>
\end
This allows the target content to be included as foldable on multiple
tiddlers, or multiple targets within one tiddler, without any interference
between their open/closed states. The only time there would be interference
is if you're including the same content into a single parent multiple
times, but that's your own fault.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/7c063182-5334-4172-bea1-9ce6d7941528%40googlegroups.com.