Can a <$button> be used to create a data tiddler?

102 views
Skip to first unread message

Chris

unread,
Jun 16, 2019, 8:42:19 PM6/16/19
to TiddlyWiki
Tried searching the forum to no avail.

Right now I have a button that populates fields. The fields needs are many and makes it clunky. Though I knew of data tiddlers it is only recently I realized there could be some potential usefulness. Here is section of my current button action.

name.middle={{$:/temp/person!!name.middle}} 
name.family={{$:/temp/person!!name.family}}
name.handle={{$:/temp/person!!name.handle}} 

date.birth={{$:/temp/person!!date.birth}} 
place.birth={{$:/temp/person!!place.birth}} 
date.baptism={{$:/temp/person!!date.baptism}} 
place.baptism={{$:/temp/person!!place.baptism}} 

date.death={{$:/temp/person!!date.death}} 
place.death={{$:/temp/person!!place.death}} 
date.burial={{$:/temp/person!!date.burial}} 
place.burial={{$:/temp/person!!place.burial}} 
cause.death={{$:/temp/person!!cause.death}} 

Setting the type to dictionary is not an issue. But is there a way to generate the output to populate data information in the text field? For instance "name.middle={{$:/temp/person!!name.middle}}" would populate in the text field as name.middle: ( value of ){{$:/temp/person!!name.middle}}?

Index numbers would not work here not only do I need "date.birth" to know what I am looking at but also ( if export it ) for someone to know what they are looking at. 

TonyM

unread,
Jun 16, 2019, 9:05:42 PM6/16/19
to TiddlyWiki
This is not a full answer but have you tried datatiddler##entryname

Rather than temptiddler!!entryname

Regards
Tony

Chris

unread,
Jun 16, 2019, 9:18:24 PM6/16/19
to TiddlyWiki
the temp file is just standard tiddler at the moment used to store the results of a form in fields. This raises an additional question . . . can you store form results in a data type tiddler?

TonyM

unread,
Jun 16, 2019, 9:30:15 PM6/16/19
to TiddlyWiki
Chris,

I was experimenting on this area I have neglected. Try this

[[mydata]]

<$edit-text tiddler="mydata" index="v1"/>

{{mydata##v1}}

<$edit-text tiddler="mydata" index="v2" tag=input/>

TonyM

unread,
Jun 16, 2019, 9:32:02 PM6/16/19
to TiddlyWiki
You would need one data tiddler per form unless the keys are qualified with a unique name such as the current tiddler.

Tony

Chris

unread,
Jun 16, 2019, 10:22:28 PM6/16/19
to TiddlyWiki
Worked, not worked. It does not work if I add this line to the button.
type="application/x-tiddler-dictionary"
It renders like a text.



Chris

unread,
Jun 16, 2019, 10:29:59 PM6/16/19
to TiddlyWiki
The tiddler is genealogical one, each generated file would include the subject name ( ex. $:/?data/** SURNAME **/** GIVEN **/** MIDDLE ** ). "$:/" is self explanatory, "?" is for sorting purposes, it sorts on top; does not get lost in the regular plugin file names and provides look up at a glance ( which is also provided by the "data" ). I will another tiddler to provide the visuals.

Mark S.

unread,
Jun 16, 2019, 10:34:28 PM6/16/19
to TiddlyWiki
You should be able to use the index property of the action-setfield widget:

<$action-setfield $tiddler="mydatatiddler" $index="name.middle" $value={{$:/temp/person!!name.middle}} />

The fields may seem clunky, but they are probably a better long-term choice, since there are so many filter operators that use them. There's very limited abilities with the dictionary tiddlers.

TonyM

unread,
Jun 17, 2019, 6:05:53 AM6/17/19
to TiddlyWiki
Mark

I favor fields as well however if we iterate datatidder keys/indexes they can be used like any title list.

For fun I just built a view template for data tiddlers that lets you edit all values in that data tiddler. It does not loose focus and you can have multiline text in multiple records in one tiddler, and in the view template you can lay them out as a form. These automatically become json format.

Regards
Tony

Watt

unread,
Jun 17, 2019, 6:41:11 AM6/17/19
to TiddlyWiki
Hi Chris
Do I understand what you want correctly?

Do you already have a lot of these genealogical records that you want to convert from fields to data tiddlers?

Do you want to keep the existing fields and extract their content into a data tiddler in the same tiddler's text area, for display convenience?

or are you just starting to create these records and want to use a form for data input into a data tiddler structure?

Is your goal a unique data tiddler for each individual containing names, birth, baptism, burial?

How many individuals are you thinking of?

I'm only just exploring data tiddlers myself but here are some observations from a fellow beginner;

Data tiddlers are sometimes easier for input and readability but the data values can be more difficult to filter and manipulate for output.

Fields are sometimes difficult for readability but are much easier for manipulating and filtering output.

Data tiddlers can greatly reduce the number of tiddlers needed, they are readable and are easy to export but those benefits depend on how many records you need to create and how you structure them.

If you make a data tiddler for each individual then you'll still create the same number of tiddlers as the fields method and might hit problems if there are identical names.

There are some useful tips on data tiddlers here;

https://kookma.github.io/TW-Scripts/#datatiddler

Data tiddlers may not exist forever in their current form, see the discussion here;
https://groups.google.com/forum/m/#!topic/TiddlyWiki/GqqPZnp6VMI

Chris

unread,
Jun 17, 2019, 9:32:54 AM6/17/19
to TiddlyWiki
True, but I think data tiddlers might work better in this case due to volume; at least enough to go down that rabbit hole. It is not only the information on person info ( birth, death, burial ) but other things too. For instance I have my maternal grandfather's discharge papers; there is wealth of data there. Then there is birth certificates, marriage, and death; that is a lot of potential data.

Chris

unread,
Jun 17, 2019, 9:49:49 AM6/17/19
to TiddlyWiki


On Monday, June 17, 2019 at 6:41:11 AM UTC-4, Watt wrote:
Hi Chris
Do I understand what you want correctly?

Do you already have a lot of these genealogical records that you want to convert from fields to data tiddlers?


Yes and no. Working on 3rd or 4th literation. Started with TW ( 2.6.0 ) because of the portability. 
 

Do you want to keep the existing fields and extract their content into a data tiddler in the same tiddler's text area, for display convenience?

or are you just starting to create these records and want to use a form for data input into a data tiddler structure?


No, has to do with the having best possible ( in relation to personal knowledge base ) efficient access to information either for review or input.
 

Is your goal a unique data tiddler for each individual containing names, birth, baptism, burial?


that how is currently set up : tiddlers for personal data ( and sources ) and additional ones for marriages, parents, children, events, etc. 
 

How many individuals are you thinking of?


Its genealogy there are always lots of records. I decided to roll it back a bit last year and focus and direct lineage families . . . still looking about 1k+ individuals; before that it more like 2k+. You always keep info you come across ( even if it doesn't directly apply ) as someone else might need it.

Chris

unread,
Jun 17, 2019, 10:06:43 AM6/17/19
to TiddlyWiki
What I think I need to do break down in two action parts . . . one to generate the content and then another change the type afterwards.
Message has been deleted

Watt

unread,
Jun 17, 2019, 11:03:01 AM6/17/19
to TiddlyWiki
Try this on an empty test wiki. Don't use it on your thousand plus geneaology wiki without having made backups.

It's not a complete solution but it might give some help. You'll need to extend it with more indexes/fields according to your needs. The wizards here on the forum might have better solutions to offer.

Paste this into a new tiddler;

\define data_title()
$:/?data/{{$:/temp/person!!name.family}}/{{$:/temp/person!!name.middle}}/{{$:/temp/person!!name.given}}
\end

\define addProfile()

<$wikify name="person_data_title" text=<<data_title>> >

<$action-setfield $tiddler=<<person_data_title>> $index=name.middle $value={{$:/temp/person!!name.middle}}/>
<$action-setfield $tiddler=<<person_data_title>> $index=name.family $value={{$:/temp/person!!name.family}}/>
<$action-setfield $tiddler=<<person_data_title>> $index=name.given $value={{$:/temp/person!!name.given}}/>


<$action-setfield $tiddler=<<person_data_title>> $field=name.middle $value={{$:/temp/person!!name.middle}}/>
<$action-setfield $tiddler=<<person_data_title>> $field=name.family $value={{$:/temp/person!!name.family}}/>
<$action-setfield $tiddler=<<person_data_title>> $field=name.given $value={{$:/temp/person!!name.given}}/>
<$action-setfield $tiddler=<<person_data_title>> $field=tags $value={{$:/temp/person!!name.family}}/>

</$wikify>

<$action-setfield $tiddler='$:/temp/person' name.family="" name.middle=""
name.given=""/>


<$action-sendmessage $message="tm-auto-save-wiki"/>
\end

Family name: <$edit-text class='tc-edit-texteditor' tiddler='$:/temp/person' field='name.family'/><br>


Middle name: <$edit-text class='tc-edit-texteditor' tiddler='$:/temp/person' field='name.middle'/><br>

Given name: <$edit-text class='tc-edit-texteditor' tiddler='$:/temp/person' field='name.given'/><br>

<$button actions=<<addProfile>> >Add </$button>

Chris

unread,
Jun 17, 2019, 8:30:08 PM6/17/19
to TiddlyWiki
Thanks! That handled the problem with the personal record part.


Reply all
Reply to author
Forward
0 new messages