Vincent vd B
Vincent vd B

Reputation: 21

Find tiddlers nested under currentTiddler?

Tiddlywiki 5.1.21 (Local file)

I want to {{||transclude}} the following code in different pages. How do I make it automatically find all tiddlers nested under the <<currentTiddler>> or $(currentTiddler)$?

(See [tag[TagNameHere] - 2nd line)

This is my code: (Found on https://kookma.github.io/TW-Shiraz/)

\define tmpSearchTid() $:/temp/demo/qa/search-slider
\define faqFilter() [tag[TagNameHere]search:title {$(tmpSearchTid)$}] 
\define revealStateTid() $:/state/shiraz/slider-macro/$(currentTiddler)$/$(currentTiddler)$

\define expand-all()
<$list filter=<<faqFilter>> >
<$action-setfield $tiddler=<<revealStateTid>> text="open"/>
</$list>
\end

\define close-all() <$action-deletetiddler $filter="[prefix[$:/state/shiraz/slider-macro/]]"/>



<$keyboard key="escape" actions='<$action-setfield $tiddler=<<tmpSearchTid>> $field="text" $value=""/>'>
<$edit-text tiddler=<<tmpSearchTid>> filed="text" tag=input default="" placeholder="Search" class="alert alert-dark w-100"/>
</$keyboard>
<$button actions=<<expand-all>> class="btn btn-secondary btn-sm">Expand all</$button>
<$button actions=<<close-all>>  class="btn btn-secondary btn-sm">Close all</$button>

<$list filter=<<faqFilter>> >
<$macrocall $name=slider label=<<currentTiddler>>  src={{!!text}} 
labelClass="alert alert-dark" srcClass="alert alert-dark"/> 
</$list>

Upvotes: 2

Views: 238

Answers (1)

Erwan
Erwan

Reputation: 1145

(Sorry I'm late :) )

Is it correct to assume that by "nested under the current tiddler" you mean "tagged with the curent tiddler"?

If yes there are several ways:

Using the variable <<currentTiddler>>

[tag<currentTiddler>]

Using a reference to the title field of the current tiddler`

[tag{!!title}]

Using the tagging operator on the current tiddler

[all[current]tagging[]]

or

[<currentTiddler>tagging[]]

Upvotes: 0

Related Questions