<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="show">Show me</$button>
</$reveal>
<$reveal type="match" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="hide">Hide me</$button>
! This is the revealed content
And this is some text
</$reveal>
Personaly I prefer setting the reveal state to a value in a field on the current tiddler so as to not over burden the tags.
Regards
Tony
Place these (untested) after the <$button> or the variation within the button definition itself.Tiddler is not specified making it apply to the currentTiddler
Tag method<$action-sendmessage $message="tm-add-tag" $param="tagname"/>
or
<$action-sendmessage $message="tm-remove-tag" $param="tagname"/>
Field method<$action-setfield $field="fieldname" text="show"/>
Or
<$action-setfield $field="fieldname" text="hide"/>A quick answer is to add an action to each button that adds or removes the required tag.
Personally I prefer setting the reveal state to a value in a field on the current tiddler so as to not over burden the tags.
Regards
Tony
<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="show">
<$action-sendmessage $message="tm-add-tag" $param="tagname"/>
Show me
</$button>
</$reveal>
<$reveal type="match" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="hide">
<$action-sendmessage $message="tm-remove-tag" $param="tagname"/>
Hide me
</$button>
! This is the revealed content
And this is some text
</$reveal><$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
<$button>
<$action-setfield $tiddler="$:/state/SampleReveal2" $field="text" text="show"/>
<$action-sendmessage $message="tm-add-tag" $param="tagname"/>
Show me
</$button>
</$reveal>
<$reveal type="match" state="$:/state/SampleReveal2" text="show">
<$button>
<$action-setfield $tiddler="$:/state/SampleReveal2" $field="text" text="hide"/>
<$action-sendmessage $message="tm-remove-tag" $param="tagname"/>
Hide me
</$button>
! This is the revealed content
And this is some text
</$reveal><$fieldmangler>
Wikitext here
</$fieldmangler><$fieldmangler>
<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="show">
<$action-sendmessage $message="tm-add-tag" $param="tagname"/>
Show me
</$button>
</$reveal>
<$reveal type="match" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="hide">
<$action-sendmessage $message="tm-remove-tag" $param="tagname"/>
Hide me
</$button>
! This is the revealed content
And this is some text
</$reveal>
</$fieldmangler>