Siblings Macro

69 views
Skip to first unread message

amreus

unread,
Aug 12, 2020, 8:48:17 PM8/12/20
to tiddl...@googlegroups.com

I have a little macro that lists the siblings of a person tiddler. Simplified, it looks like so:

\define siblings()
''Siblings''
<$list filter="[has[famc]field:famc{!!famc}]">
<br><$link>{{!!caption}}</$link>
</$list>
\end

This lists all tiddlers that have a matching `famc` field, including the current tiddler.

How can I make it not link to the current tiddler? 

I want to list and link to the siblings, but only list the current tiddler with no link.


TW Tones

unread,
Aug 12, 2020, 10:27:31 PM8/12/20
to TiddlyWiki
Amerus

Here is a somplified version which excludes the current tiddler

\define siblings()
''Siblings''
<$list filter="[all[]famc{!!famc}] -[<currentTiddler>]">

<br><$link>{{!!caption}}</$link>
</$list>
\end
untested

It uses the short form of fieldname[fieldvalue] to test a fields value, and gets this value from the field in the current tiddler.


Regards
Tones

Eric Shulman

unread,
Aug 12, 2020, 10:30:36 PM8/12/20
to TiddlyWiki
Try this:
\define siblings()
''Siblings''
<$vars here=<<currentTiddler>>>

<$list filter="[has[famc]field:famc{!!famc}]">
   
<br>

   
<$list filter="[<currentTiddler>match<here>]">  {{!!caption}}                </$list>
   <$list filter="[<currentTiddler>!match<here>]"> <$link>{{!!caption}}</
$link> </$list>
</
$list>
</$vars>
\end
 

amreus

unread,
Aug 12, 2020, 11:00:03 PM8/12/20
to TiddlyWiki
Thanks Tony - I actually want to list the tiddler just not display it as a link since in theory I am already viewing that tiddler. Plus showing the person in plain text acts as a hint to where in the birth-order the person is.

amreus

unread,
Aug 12, 2020, 11:01:30 PM8/12/20
to TiddlyWiki
Thanks Eric.  I should have also mentioned I want to keep the birth order of the siblings based on a `birt-date` field.  I won't have a chance to try any of this until late tomorrow.

amreus

unread,
Aug 12, 2020, 11:05:26 PM8/12/20
to TiddlyWiki
I lied - I couldn't wait to try.. @Eric I see your macro does not change the sort order.  It looks like it's going to work great. Thanks again.
Reply all
Reply to author
Forward
0 new messages