[TW5] Put title of tiddler in filter of fields

114 views
Skip to first unread message

Alex

unread,
Jan 23, 2017, 9:35:26 AM1/23/17
to tiddl...@googlegroups.com
Hi, I'm trying to filter and transclude tiddlers with a special field and the title of current tiddler, but nothing worked:

1)

<$list filter="[field:relatedto[$(title)$]">

''<$transclude field="caption" />''

<$transclude />

</$list>

I'm trying to transclude all tiddlers, which got the name of the current in the "relatedto" field. But this did not work. I already tried:

<$list filter="[field:relatedto[!!title]">

<$list filter="[field:relatedto{{!!title}}]">

<$list filter="[field:relatedto<currentTiddler>]">

<$list filter="[field:relatedto<<currentTiddler>>]">

<$list filter="[field:relatedto[{{!title}}]">


Nothing works.

2)

Same here:

<<tabs "[tag<<{{!!title}}field:relatedto[]] " "" "$:/state/tab2" "tc-vertical">>

Here, I want to show all tiddlers in the vertical tab-view, which got the title of the current as a tag. But I always had to "hardcode" the title of the current tiddler and could not transclude the title in the filters


Anyone got an idea?

Best regards,

Alex

Jed Carty

unread,
Jan 23, 2017, 10:29:03 AM1/23/17
to TiddlyWiki
Someone wrote up a big list of how all of this works, but I don't know where it is at the moment. The quick answer is you use single curly braces in filters when referring to fields like this:

<$list filter="[field:relatedto{!!title}]">

If you are trying to refer to a variable you use single < and > like this:

<$list filter="[field:relatedto<currentTiddler>]">

if you inside a macro and are referring to a variable that is define outside the macrocell you can use

<$list filter="[field:relatedto[$(variableName)$]]'>

Alex

unread,
Jan 23, 2017, 10:59:33 AM1/23/17
to tiddl...@googlegroups.com
Hi Jed,

thanks for your answer.


<$list filter="[field:relatedto{!!title}]">

This works.

If you are trying to refer to a variable you use single < and > like this:

<$list filter="[field:relatedto<currentTiddler>]">

This works, too.


if you inside a macro and are referring to a variable that is define outside the macrocell you can use

<$list filter="[field:relatedto[$(variableName)$]]'>


My problem was, that I did not thought about this variable. I got no list on my "preview" during editing this tiddler. But now I get, at this moment this variable contains "Draft of ....". Only after exiting the editing-mode I got the real title.

This leads to my second problem: If I try to transclude this tiddler to some other tiddlers, the "title"-variable changes and the content ist not shown.

Example:

Tiddler A: (field relatedto:"B")

Text A

Tiddler B: (tag: "C")

<$list filter="[field:relatedto[$(title)$]">

''<$transclude field="caption" />''

<$transclude />

</$list>

Text B

looks like:

Text A
Text B

Tiddler C:

<<tabs "[tag{!!title}field:relatedto[]] " "" "$:/state/tab2" "tc-vertical">>

Text C

**tag=C & field relatedto is empty

looks like:

Text B
Text C

Because {{!!title}} of Tiddler B is now "C" and not "B". How could I force Tiddler C to get the output text of Tiddler B and not take the coded text with the "{{!!title}}"-variable to looks like:

Text A
Text B
Text C

Alex

unread,
Jan 23, 2017, 2:58:55 PM1/23/17
to TiddlyWiki
OK, I did it like that:


Tiddler A: (field relatedto:"B")

Text A

Tiddler B: (tag: "C")

<$tiddler tiddler=<<currentTab>>>


<$list filter="[field:relatedto{!!title}]">

''<$transclude field="caption" />''

<$transclude />

</$list>
</$tiddler>

Text B

looks like:

Text A
Text B

Tiddler C:

<<tabs "[tag{!!title}field:relatedto[]] " "" "$:/state/tab2" "tc-vertical">>

Text C

**tag=C & field relatedto is empty

now looks like:


Text A
Text B
Text C

Reply all
Reply to author
Forward
0 new messages