While Eric solution is elegant one, using the *new features in Tiddlywiki 
5.1.23* the Eric solution can be simplified as below


<$list filter="[tag<currentTiddler>!sort[title]]">
<$vars stateTid={{{ [[$:/state/slider/]addsuffix<currentTiddler>] }}}>
<h2>
<$button class="tc-btn-invisible" >  <$text text={{!!title}} />
<$action-listops $tiddler=<<stateTid>> $field="text" 
$subfilter="+[toggle[show],[hide]]" />
</$button>
</h2>
<$reveal state=<<stateTid>> type="match" text="show">
   <$transclude field="text" mode="block"/>
</$reveal>
</$vars>
</$list>


This new solution uses the semantic operator *toggle*, which lets you to 
switch between two opposite states (show, hide). More information can be 
fined
https://tiddlywiki.com/prerelease/#toggle%20Operator


The below example further shows the use of toggle operator to create a 
simple slider

\define tslider(tiddler)
<$vars stateTid="$:/state/toggle-slider/$tiddler$">
<$button class="tc-btn-invisible">  <$text text={{{ 
[<stateTid>get[text]match[show]then[hide]else[show]] }}}/>
<$action-listops $tiddler=<<stateTid>> $field="text" 
$subfilter="+[toggle[show],[hide]]" />
</$button>
<$reveal state=<<stateTid>> type="match" text="show">
   <$transclude tiddler=<<__tiddler__>> field="text" mode="block"/>
</$reveal>
</$vars>
\end

Copy the above code and put in an empty tiddler with the below line

<<tslider HelloThere>>

and see how it nicely works!

Thank you Saq, and Jeremy for such great features!

Best wishes
Mohammad




On Sunday, November 8, 2020 at 3:56:07 PM UTC+3:30 Eric Shulman wrote:

> On Sunday, November 8, 2020 at 2:08:47 AM UTC-8, Sapphireslinger wrote:
>>
>> Is there a way to do this?
>>
>> <$list filter="[tag<currentTiddler>!sort[title]]">
>> <h2><$link><$transclude field="title" mode="block"/></$link></h2> *This 
>> line is what I want sliderized.*
>> <$transclude field="text" mode="block"/> *Only want this to show up 
>> (inline) if I click on the above title.*
>> </$list>
>>
>
> Try this:
> <$list filter="[tag<currentTiddler>!sort[title]]">
> <h2>
> <$button class="tc-btn-invisible" >
>    <$text text={{!!title}} />
>    <$reveal state={{{ [[$:/state/slider/]addsuffix<currentTiddler>] }}} 
> type="nomatch" text="show">
>       <$action-setfield $tiddler={{{ 
> [[$:/state/slider/]addsuffix<currentTiddler>] }}} text="show" />
>    </$reveal>
>    <$reveal state={{{ [[$:/state/slider/]addsuffix<currentTiddler>] }}} 
> type="match" text="show">
>       <$action-deletetiddler $tiddler={{{ 
> [[$:/state/slider/]addsuffix<currentTiddler>] }}} />
>    </$reveal>
> </$button>
> </h2>
> <$reveal state={{{ [[$:/state/slider/]addsuffix<currentTiddler>] }}} 
> type="match" text="show">
>    <$transclude field="text" mode="block"/>
> </$reveal>
> </$list>
>
> Notes:
> * $button uses class="tc-btn-invisible" to make it look like regular text
> * $text shows the current title
> * 1st $reveal sets $:/state/slider/NameOfTiddler to "show" when $button is 
> pressed
> * 2nd $reveal deletes $:/state/slider/NameOfTiddler when $button is pressed
> * 3rd $reveal does $transclude when $:/state/slider/NameOfTiddler is set 
> to "show"
>
> 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/2a20ad10-26b4-4961-a3a9-c99e05853ea5n%40googlegroups.com.

Reply via email to