Auto linking Tiddlers using Fields

I know it is possible to automatically create links between tiddlers using Tags, but is it also possible to create links by using the fields.

So for example, I am creating tiddler to represent a new person “Child” and I have two fields “Father” and “Mother”. If I populate these with the father’s and mother’s names can I in effect transculde the content so that the Father and Mother’s content appears, say at the foot of the Tiddler.

Is the reverse possible, so that when viewing the “Father” the “Child” content is included?

All these people tiddlers would use the same template:

Title: Person’s name
Father (field): Father’s name
Mother (field): Mother’s name

Thanks.

If the contents of the Father field is the title a tiddler, then

<$transclude tiddler={{!!Father}}/>

will transclude the text field contents from the Father tiddler.

1 Like

If you think about what the tags field is capable of, multiple tags or a list, the same can be reproduced with any other field or they can just be used to hold a single name.

If you to decide to use another field to contain a list of tiddlers eg one or more children you need to add or remove items from the field such that existing items remain in place. That is you can’t use actionSetfield unless you set it to the full list of items.

  • To do this adding and removing titles to/from a list we make use of
    • the Listops Operators to generate a new list and then use ActionSetFieldWidget
    • or make use of other tools like the SelectWidget with the multiple setting
    • In the next version the checkbox widget will provide an add/remove from list field option
    • You can also make use of the ActionListopsWidget through its subfilter you can “+[[child name]]” or “-[[child name]]”

There is also the possibility of building separate tags fields using inmysocks GenTags plugin but in this case I think it may be overkill.

Notes;

  • To permanently modify a tiddler, or field you need some kind of action triggered by a button or other trigger
  • You could choose to have only one value in Mother and Father fields but remember there can be different kinds of parents, over time or step vs biological.
    • Or imply who is the child of someone by naming their parent

I just discovered by accident a “poor man’s” alternative to GenTags and since TW v5.1.23 allows you to set a different tag field. See tag-picker Macro

  • Now all I need is to do is to be able to add a filter to this, so you can select from other titles for example; a filter than lists all tiddler that are a person, who’s birthdate, is after the current tiddler or unknown, thus a potential child of the current tiddler.
  • Once selected is added to tags or a nominated field like children

@TW_Tones thanks for these two posts, lots to think about and try here.

1 Like