Rahul,

Here are macros that I used to build a collapsible table of contents with 
the slider macro from the Shiraz plugin. I switched from details to slider 
because slider retains state, but the idea should be the same.

\define suboutline()
  <$list filter="[<currentTiddler>has[text]]">
    <$transclude mode="block"/>
  </$list>
  <$macrocall $name="outline"/>
\end

\define outline(field:"list")
  <$list filter="[<currentTiddler>has[$field$]$field$[]]">
    <<slider label:<$link/> src:"""$(suboutline)$""">>
  </$list>
\end




On Saturday, May 23, 2020 at 1:20:54 AM UTC-4, Rahul Kashyap wrote:
>
> Hello everyone,
>
> Could someone please help me with a particular implementation that I'm 
> trying to achieve?  Any help would be appreciated. 
>
> I want to use a macro for all the tiddlers satisfying a certain filter 
> esp. (demo/details/details-macro (
> https://kookma.github.io/TW-Shiraz/#Install) macro of Shiraz. 
>
> I know that {{!!title}} or <$view field='title'/>  prints the title of 
> the tiddlers  and I can use <$transclude mode="block"/> to transclude the 
> content as well but, I couldn't transclude them inside the macro. 
> I also tried a template unsuccessfully. 
>
> <$list filter="[tag[my_tag]]">
>
>
> <<details sum:"[[tiddler_variable_in_the_loop]]" src:
> "{{tiddler_variable_in_the_loop}}">>   // desired output with visible 
> link and hidden translusion 
>
>
> <<details sum:"{{!!title}}" src:<$transclude mode="block"/> >>   // 
> displays the title of the tiddler without link; do not transclude. 
> <<currentTiddler>>{{||$:/rkashyap/template/detail}}   // similar to above
>
>
> <$transclude mode="block"/>   // transludes the whole content without 
> hiding it 
> </$list>
>
>
> The code below achieves the task if the title of the tiddlers are not 
> CamelCase in which case it opens the tiddler which I don't want. 
> <$appear show= {{!!title}} >
> <$transclude mode="block"/>
> </$appear>
>
>
> Thanks,
> -Rahul
>
> On Saturday, June 2, 2018 at 2:08:42 PM UTC-4, Mohammad wrote:
>>
>> Mat!
>>  I started to do that! I found the Jed introduction to lists very 
>> interesting, but as you said, the secret is in using filters.
>> Also as Tony advised, I found reading other codes useful, while the 
>> learning curve in this way is not short!
>>
>> Cheers
>> Mohammad
>>
>>
>> On Saturday, June 2, 2018 at 4:43:20 PM UTC+4:30, Mat wrote:
>>>
>>> Mohammad, IMO the "secret" is not to "learn the listwidget" but to study 
>>> the *filter operators*.
>>>
>>> <:-)
>>>
>>

-- 
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/185aaedb-462e-41e0-8607-954c6ae1d2e2%40googlegroups.com.

Reply via email to