Hello, That worked perfectly, thanks! I knew there was some kind of syntax trick I was missing. Honestly, the reason for the two gender loops was just my own confusion. Intuitively, I couldn't think of another way to list parent-child relationships in a way that was agnostic towards which parent it was - now I realise I could have had <td><<list-links [field:father{!!title}]>><<list-links [field:mother{!!title}]>></td> and that would have worked.
Looking at it, I agree there are still possibly needless loops - although it does the job, so I'm not complaining! <$vars haschild="[all[tiddlers]field:mother{!!title}limit[1]]"> <$list filter="[all[current]gender[female]filter<haschild>]"> <tr> <td>''Children''</td> <td><<list-links [field:mother{!!title}]>></td> </tr> </$list> </$vars> <$vars haschild="[all[tiddlers]field:father{!!title}limit[1]]"> <$list filter="[all[current]gender[male]filter<haschild>]"> <tr> <td>''Children''</td> <td><<list-links [field:father{!!title}]>></td> </tr> </$list> </$vars> I've tinkered with it to produce this: <$vars haschild="[all[tiddlers]field:mother{!!title}field:father{!!title}sum[]limit[1]]"> <$list filter="[all[current]filter<haschild>]"> <tr> <td>''Children''</td> <td><<list-links [field:mother{!!title}]>><<list-links [field:father{!!title}]>></td> </tr> </$list> </$vars> Which seems to work and is a lot less wordy Thanks a lot! On Sunday, November 7, 2021 at 2:37:25 PM UTC Mark S. wrote: > > Your "male" line has an error. There is a missing square bracket on the > end: > > <$list filter="[all[current]gender[male]"> > > Since you don't have a label that says "mother" or "father", I don't know > why you have two gender loops. > > You should be able to add a filter operator to the gender list loop > > <$vars haschild="[all[tiddlers]field:father{!!title}limit[1]]"> > <$list filter="[all[current]gender[male]filter<haschild>]"> > <tr> > <td>''Children''</td> > <td><<list-links [field:father{!!title}]>></td> > </tr> > </$list> > </$vars> > > On Sunday, November 7, 2021 at 3:17:23 AM UTC-8 merry.ma...@gmail.com > wrote: > >> Hello! >> >> Okay, so the context for this is that I have, or will have, a database of >> many, many interrelated individuals. Each of those individuals has a >> 'mother' and a 'father'. I can currently get tiddlywiki to display lists of >> children each individual has, based on their name showing up in the mother >> or father field of another tiddler. What I can't figure out how to do is >> get the 'Children' row of the table not to show when an individual has no >> children. >> >> For other fields I can do something like this: >> <$list filter="[all[current]has[secondaryeducation]]"> >> <tr> >> <td>''Secondary Education''</td> >> <td><$link to={{!!secondaryeducation}} /></td> >> </tr></$list> >> >> When an individual doesn't have the secondaryeducation field, the row >> doesn't show up in the sidebox. >> >> My current set up for listing children looks like this >> >> <$list filter="[all[current]gender[female]]"> >> <tr> >> <td>''Children''</td> >> <td><<list-links [field:mother{!!title}]>></td> >> </tr></$list> >> <$list filter="[all[current]gender[male]"> >> <tr> >> <td>''Children''</td> >> <td><<list-links [field:father{!!title}]>></td> >> </tr></$list> >> <$list filter="[all[current]has[id]]"> >> >> If the individual is female, it looks for instances of the title of the >> individuals tiddler being listed as the mother in other tiddlers. Vice >> versa for males. >> >> I've fiddled with lots of widgets. I think the problem is that this >> syntax [field:father{!!title}] doesn't play well... >> >> Also, if you have better alternative methods of achieving this goal, I'm >> all ears! I know filling in a 'Children' field, would solve this problem, >> but I want to cut manual data input to a minimum, and in principle all >> biological familial relationships (siblings, aunts, grandparents...etc.) >> can be expressed in mother-child, and father-child relationships. >> >> -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6f45b9e5-d284-4196-bffd-c3b7e9458d31n%40googlegroups.com.