I would avoid complicated structures like JSON, since the tools in TW won't
let you work with them easily. In most cases, it will be easier to use
other tiddlers as if they formed the related table in a relational database.
I think you want each individual to have multiple contact structures. You
could store these in separate tiddlers. (e.g. Person1-Contact1,
Person1-Contact2). Then have a list field like "contacts" that stores the
name of related contact structures:
contacts: [[Person1-Contact1]] [[Person1-Contact2]]
You could have a template for each person. And a contact Template. Your
person template would call the contact template:
<$edit field="vorname" .... whatever else needs to be edited here ...>
<$list filter=[enlist{!!contacts}] >
{{||contactTemplate}}
</$list>
The contact template exposes fields like phone number:
Phone: <$edit-text field="phone1" size=20 tag="input"/>
Good luck!
-- Mark
On Monday, October 29, 2018 at 7:45:59 AM UTC-7, Tristan Kohl wrote:
>
> Hey guys,
>
> I have an issue with my current project. I am not sure how one would
> tackle this problem so I hope one of you could help me:
>
> I have a tiddler representing a person which gets rendered through a
> template to display some fields. After creation there are only three
> fields: forename, surname and birthday. However in my template I would like
> to have a edit-text widget by what I would add contact informations to that
> contact. I could create a new tiddler for every phone number, email etc.
> but since those values are tightly coupled to a person I think it would be
> easier to manage if I put those inside the person tiddler as they are no
> longer useful if I delete this person (I would put them in the same table
> in a relational database as well).
>
> But here comes my current problem into play as I do not know how to store
> an arbitrary amount of contact informations inside a field so I can nicely
> iterate over them in the template for display. My second idea was to make
> the person tiddler a dictionary tiddler and pass it through a template upon
> request but I have no idea how one would do this and if that would even be
> possible.
>
> *TL;DR;*
> How do I store an arbitrary amount of values inside a field (JSON maybe?)
> and how to iterate over them? Is there a better alternative?
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/380e90e1-d99d-4528-acf0-11f7f12fa408%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.