This kind of crazy. 

It is a set of expanding sections applied to a list filter.

It uses a checkbox with a field instead of a button. 

I'm actually very confused as to why/how the checkbox field works with the 
state tiddler. Except that the qualify macro is applied to the checkbox 
field's name. 

<$set fieldName=<<qualify "showdit">>>
<$list filter="[tag[Wiki Related]sort[title]] -[regexp:title[^Draft of.*]]">
<style type="text/css">
.exheading [type="checkbox"]{display:none;}
</style>
<div class="exheading">
<$checkbox field="showstate" checked="yes" unchecked="no">
<h2 style="border-radius:4px; text-decoration:none; border:0px; 
margin-top:6px; margin-bottom:4px; padding-left:6px; padding-top:6px; 
padding-bottom:2px; background-color:#3A3A3A;">
{{$:/core/images/unfold-button}}
<$transclude field="title" mode="inline"/><span style="position: absolute; 
right: 2%; font-size:smaller;"><$link>[edit]</$link></span>
</h2>
</$checkbox>
</div>
<div style="margin-left:30px; margin-right:15px;">
<$reveal state="!!showstate" type="match" text="yes">
<$transclude field="text" mode="block"/>
</$reveal>
</div>
</$list>
</$set>
<$list filter="[tag[Game Projects]sort[title]] -[regexp:title[^Draft 
of.*]]">
<style type="text/css">
.exheading [type="checkbox"]{display:none;}
</style>
<div class="exheading">
<$checkbox field="showtest" checked="yes" unchecked="no">
<h2 style="border-radius:4px; text-decoration:none; border:0px; 
margin-top:6px; margin-bottom:4px; padding-left:6px; padding-top:6px; 
padding-bottom:2px; background-color:#3A3A3A;">
{{$:/core/images/unfold-button}}
<$transclude field="title" mode="inline"/><span style="position: absolute; 
right: 2%; font-size:smaller;"><$link>[edit]</$link></span>
</h2>
</$checkbox>
</div>
<div style="margin-left:30px; margin-right:15px;">
<$reveal state="!!showtest" type="match" text="yes">
<$transclude field="text" mode="block"/>
</$reveal>
</div>
</$list>

On Tuesday, May 19, 2020 at 1:01:11 PM UTC-4 Reet Pandher wrote:

> Final Version:
> \define fold(heading, text)
> <$button class="tc-btn-invisible" popup=<<qualify 
> "$:/state/section$heading$">>>
>
>
> $heading$ {{$:/core/images/fold-button}}
>
> </$button>
> <$reveal type="nomatch" state=<<qualify "$:/state/section$heading$">> 
> text="">
> $text$
> </$reveal>
> \end
>
> Changed the image from chevron-right to fold-button. It is a smaller icon 
> so it doesn't bother as much without the animation!!
>
> On Tuesday, May 19, 2020 at 10:15:35 PM UTC+5:30, Reet Pandher wrote:
>>
>> I tried this version and it seems to work:
>> \define fold(heading, text)
>> <$button class="tc-btn-invisible" popup=<<qualify 
>> "$:/state/section$heading$">>>
>>
>> $heading$ {{$:/core/images/chevron-right}}
>> </$button>
>> <$reveal type="nomatch" state=<<qualify "$:/state/section$heading$">> 
>> text="">
>> $text$
>> </$reveal>
>> \end
>>
>> Only problem is that the arrow button now stays the same but i think i 
>> can live with it. Also, is there any smaller and vertical arrow that can be 
>> used in place of the current one?
>> Thanks
>>
>> On Tuesday, May 19, 2020 at 8:58:45 PM UTC+5:30, Eric Shulman wrote:
>>>
>>> On Tuesday, May 19, 2020 at 8:08:15 AM UTC-7, Reet Pandher wrote:
>>>>
>>>> I tried it and it displays the heading with the right arrow but when i 
>>>> click on the heading to expand text, no text appears *and *the heading 
>>>> disappears as well. When i click anywhere on the screen the heading 
>>>> re-appears.
>>>>
>>>>
>>> oops!  I left out a closing /$reveal and the $button wrapper around the 
>>> second heading... here's the fixed macro:
>>>
>>> \define fold(heading, text)
>>> <$reveal type="match" state=<<qualify "$:/state/section$heading$">> 
>>> text="">
>>> <$button class="tc-btn-invisible" popup=<<qualify 
>>> "$:/state/section$heading$">>>
>>>
>>> $heading$ {{$:/core/images/chevron-right}}
>>> </$button>
>>> </$reveal>
>>> <$reveal type="nomatch" state=<<qualify "$:/state/section$heading$">> 
>>> text="">
>>> <$button class="tc-btn-invisible" popup=<<qualify 
>>> "$:/state/section$heading$">>>
>>>
>>> $heading$ {{$:/core/images/chevron-down}}
>>> </$button><br>
>>> $text$
>>> </$reveal>
>>> \end
>>>
>>> <<fold "test1" """this is a test""">>
>>> <<fold "test2" """another test""">>
>>>
>>> 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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8a654fb2-3396-4190-b0b2-9c337d774bf1n%40googlegroups.com.

Reply via email to