[tw5] Re: Conditional Reveal based on whether tiddler title shows up in fields of other tiddlers
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 <><> 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]"> ''Children'' <> <$vars haschild="[all[tiddlers]field:father{!!title}limit[1]]"> <$list filter="[all[current]gender[male]filter]"> ''Children'' <> 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]"> ''Children'' <><> 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]"> > > ''Children'' > <> > > > > > 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]]"> >> >> ''Secondary Education'' >> <$link to={{!!secondaryeducation}} /> >> >> >> 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]]"> >> >> ''Children'' >> <> >> >> <$list filter="[all[current]gender[male]"> >> >> ''Children'' >> <> >> >> <$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.
[tw5] Conditional Reveal based on whether tiddler title shows up in fields of other tiddlers
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]]"> ''Secondary Education'' <$link to={{!!secondaryeducation}} /> 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]]"> ''Children'' <> <$list filter="[all[current]gender[male]"> ''Children'' <> <$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/e4a08ad9-3e2c-421b-8210-64c2fd706590n%40googlegroups.com.
[tw5] Re: Linking to Field Values
@Eric Shulman Great, that works, thanks! Really minor follow-up question. What do I have to put before [field:father-id{!!id}] to get it to actually show up on the page as text and a link? Currently, I can do this: <> (which is the inverse, for finding fathers as opposed to finding sons) but that produces a list e.g. - Robert Smith I just want it to show Robert Smith Because people only have one biological father! I think the <> bit is a 'macro'? I've tried: <[field:id{!!father}]> <<[field:id{!!father}]>> <<$link [field:id{!!father}]>> <$link to=[field:id{!!father}]>[field:id{!!father}] All with no luck. Slightly more general question, I've found myself a bit baffled by macros/whatever they are. TiddlyWiki as loads of examples of operators, but unless you know what you need to put before them, they aren't actually usable! For example, I know the subtract operator looks like this: [[23]subtract[19]] But obviously, just putting that in a tiddler doesn't produce the value "4", you have to put something before it. I've got no clue what that should be, and the code actually used in the wiki: <<.operator-example 1 "[[23]subtract[19]]">> Does not work. Sorry to dump loads of questions! I just get the impression that TiddlyWiki is incredibly powerful and perfect for my use-case, but there is a lot of basic syntax stuff that I just don't get. On Sunday, June 27, 2021 at 1:13:52 PM UTC+1 Eric Shulman wrote: > On Sunday, June 27, 2021 at 4:04:14 AM UTC-7 merry.ma...@gmail.com wrote: > >> Now doing this <> >> Works to retrieve the children of Robert Smith. However, that involves >> manually typing in Robert Smith's id. Instead I want something like >> this: <> >> But that doesn't work... >> > > When specifying the parameter value for a filter operator, *the type of > brackets indicate the kind of parameter value* you are using: > > square brackets are for *literal* values, e.g. > [field:father-id[634750-LiR]] > angle brackets are for *variable* values, e.g., > [field:father-id] > curly braces are for *field references*, e.g., [field:father-id{!!id}] > > Also note that within filter syntax, use *single* brackets/braces, rather > than the *doubled* brackets/braces that are used within regular wiki text > syntax; > i.e., [634750-LiR] instead of [[634750-LiR]], instead of > <>, and {!!id}} instead of {{!!id}} > > enjoy, > -e > -- 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/a7683e9a-7bb6-48d4-8d67-054bc776fd6bn%40googlegroups.com.
[tw5] Re: Linking to Field Values
Sorry, supplemental question involving using fieldsĀ¬ Another thing I want to do is use id and father-id / mother-id fields to automatically list the children of an individual. Ids are preferable to just names/titles, because of the chance of duplicate names. How it might work is this. Say Robert Smith has two sons, John Smith and Peter Smith. That could be represented in fields like this: (John Smith fields) id: 365974-LlO father-id: 634750-LiR (Peter Smith fields) id: 571157-OnU father-id: 634750-LiR (Robert Smith fields) id: 634750-LiR father-id: 612745-GbF Now doing this <> Works to retrieve the children of Robert Smith. However, that involves manually typing in Robert Smith's id. Instead I want something like this: <> But that doesn't work... On Sunday, June 27, 2021 at 10:07:48 AM UTC+1 Merry Machiavelli wrote: > Thank you so much @Soren Bjornstad, that works perfectly! I think I tried > something close to that at one point, I just messed up the syntax! > > @iamdar my use case is that I want to be able to mass-produce > wikipedia-style bios for individuals, where the the same basic info comes > up in multiple parts of the 'article'/tiddler. > > For example, in the opening line, it might say "John Smith was born in > MadeupLand", the side bar might also mention he was born in MadeupLand. If > I link both references to MadeupLand through a field i.e. using <$link > to={{!!birthcountry}} /> then I only have to specify the country John Smith > was born in once, in the field. If I iterate this process 100 times (using > the same code for most of the body of the article, just customising it with > novel information) it saves a lot of typing. > > Another advantage is that it makes it easier to call groups of people who > share a particle bit of vital information, without necessary creating a tag > for, say, "born in 1872" (which, I could do...it just seemed clunky?). The > main example that comes to mind is using surnames as a way to list every > individual from a particular patrilineal lineage (assuming it's an unusual > surname that unrelated individuals are unlikely to share within my > group...I could also have a specific familyID field). > > > -- 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/1ae075b9-7506-45f0-8362-d9a9ade08920n%40googlegroups.com.
[tw5] Re: Linking to Field Values
Thank you so much @Soren Bjornstad, that works perfectly! I think I tried something close to that at one point, I just messed up the syntax! @iamdar my use case is that I want to be able to mass-produce wikipedia-style bios for individuals, where the the same basic info comes up in multiple parts of the 'article'/tiddler. For example, in the opening line, it might say "John Smith was born in MadeupLand", the side bar might also mention he was born in MadeupLand. If I link both references to MadeupLand through a field i.e. using <$link to={{!!birthcountry}} /> then I only have to specify the country John Smith was born in once, in the field. If I iterate this process 100 times (using the same code for most of the body of the article, just customising it with novel information) it saves a lot of typing. Another advantage is that it makes it easier to call groups of people who share a particle bit of vital information, without necessary creating a tag for, say, "born in 1872" (which, I could do...it just seemed clunky?). The main example that comes to mind is using surnames as a way to list every individual from a particular patrilineal lineage (assuming it's an unusual surname that unrelated individuals are unlikely to share within my group...I could also have a specific familyID field). -- 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/0aee69dd-f86c-4e06-b9ed-a18d5e55d74en%40googlegroups.com.
[tw5] Linking to Field Values
Hello, I think this is a pretty basic problem, but I've not been able to figure out how to do it. Within tiddlywiki, I have profiles for made-up individuals. I have birthcountry of each individual recorded as a field. I also have wikipedia-style sideboxes with individuals date of birth, date of death, parentage, childrenetc and birthcountry as well. All I want to do is have it so that I can use the birthcountry field to supply a value that I can use as both text and a link to another tiddler. For example: John Smith Born - 04/05/1872 - Fantasyshire, MadeupLand (with "MadeupLand" value drawn from the field and also used link to a tiddler with the title "MadeupLand") Currently, I can retrieve the field value: <$view field=birthcountry/> And I can manually link to 'MadeupLand': <$link to="MadeupLand"> But putting them together like this: <$link to=<$view field=birthcountry/> Does not work, I just get "true" Any help would be much appreciated! -- 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/44c6805f-cb7f-4c00-bb86-17be91ca6579n%40googlegroups.com.