Hi Ilmari,
You use the same state tiddler for both buttons; you need a separate state
tiddler for each button.
Try this:
!<$reveal type="nomatch" state="$:/state/SampleReveal1" text="show">
<$button set="$:/state/SampleReveal1" setTo="show">Example 1</$button>
</$reveal>
!<$reveal type="match" state="$:/state/SampleReveal1" text="show">
Example text
<$button set="$:/state/SampleReveal1" setTo="hide">Piilota</$button>
</$reveal>
!<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="show">Example 2</$button>
</$reveal>
!<$reveal type="match" state="$:/state/SampleReveal2" text="show">
Example text
<$button set="$:/state/SampleReveal2" setTo="hide">Piilota</$button>
</$reveal>
Cheers,
Ton
On Friday, July 15, 2016 at 8:34:27 AM UTC+2, Ilmari Kumpula wrote:
>
> Hello!
>
> I'm having a following problem with a Tiddler, which contains multiple
> Expand and Collapse sections. The expand-collapse function works great, but
> when i expand one section, they all expand and when i collapse, they all
> collapse. What should i do with my code so it wouldn't do that?
>
> Ilmari
>
>
>
> !<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
> <$button set="$:/state/SampleReveal2" setTo="show">Example 1</$button>
> </$reveal>
> !<$reveal type="match" state="$:/state/SampleReveal2" text="show">
> Example text
> <$button set="$:/state/SampleReveal2" setTo="hide">Piilota</$button>
>
>
>
> </$reveal>
>
>
> !<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
> <$button set="$:/state/SampleReveal2" setTo="show">Example 2</$button>
> </$reveal>
> !<$reveal type="match" state="$:/state/SampleReveal2" text="show">
> Example text
> <$button set="$:/state/SampleReveal2" setTo="hide">Piilota</$button>
>
>
>
> </$reveal>
>
>
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/568339c1-18b9-4ae7-a0b0-a2a62191669b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.