Oh my god THANK YOU this was driving me nuts. I read that the popups are 
dismissed on click but I thought that you need to click the popup itself to 
dismiss it and I just never realised that you really do not have to.

Just one question, if I understand correclty the setTo=... is just a filter 
that checks whether the value of test1 is "hide", if it is, it outputs 
"show", if not then it outputs "hide". However, why do we need the triple 
braces around the filter? 

BR,
Petri

On Thursday, September 9, 2021 at 4:31:19 PM UTC+3 Eric Shulman wrote:

> On Thursday, September 9, 2021 at 2:56:13 AM UTC-7 Petri M. wrote:
>
>> I can't figure this one out. So, I have a sidebar search tiddler where I 
>> want to show three different kinds of searches at the same time but I want 
>> each of them to be collapsable for easy navigation. I got everything else 
>> working fine but I cannot figure out how to get them to collapse and expand 
>> independently.
>>
>
> Popups are intended to* appear only when the corresponding state tiddler 
> has a value* and the TWCore system *automatically dismisses popups when 
> it detects a click elsewhere.*
>
> However, your goal is to have an "anti-popup" that has the inverse 
> behavior... i.e., it defaults to being visible unless the state tiddler 
> value is set by a button click, and then remains that way until the button 
> is clicked again.  The solution is to *not use popups at all.*  Instead, 
> you want the button to simply toggle the state tiddler between blank and 
> non-blank and then use that value to determine when to show the associated 
> content.
>
> Here's one way to write this using set/setTo and a "filtered transclusion" 
> to calculate the desired state value:
>
> <$button class="sidebar-collapsible" 
> selectedClass="sidebar-collapsible-onclick"
>    set="test1" setTo={{{ [{test1}match[hide]then[show]else[hide]] 
> }}}>Title matches:</$button>
> <$reveal state="test1" type="nomatch" text="hide"> ... t1 </$reveal>
>
> <$button class="sidebar-collapsible" 
> selectedClass="sidebar-collapsible-onclick"
>    set="test2" setTo={{{ [{test2}match[hide]then[show]else[hide]] 
> }}}>Title matches:</$button>
> <$reveal state="test2" type="nomatch" text="hide"> ... t2 </$reveal>
>
> Note: The current value of the state tiddlers will be retained when you 
> save your file.  However, if you want the state tiddlers to be reset when 
> you save the file, *name them starting with "$:/state/popup/"*.  By 
> default, tiddlers with that prefix are not retained when the file is saved.
>
> enjoy,
> -e
>

-- 
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/c35dc1d9-e69d-4193-bb69-94010a20bda5n%40googlegroups.com.

Reply via email to