With a big nod to @TW_Tones for offering some ideas about fields here in this earlier thread, I want to begin with one easy and powerful tweak to TiddlyWiki: render fieldnames (wherever fieldnames are doing their thing) as links, making it easier to access and handle fieldnames as useful nodes in the story river. Then, new vistas open up…
(I’ve previously mentioned fieldname nodes as part of my virtual tiddlers approach. But this post is actually a distinct proposal: you could see fieldnames as powerful tiddlers/nodes without having any magic for “missing-tiddler” nodes, and vice versa. The two work well together, but are logically independent.)
Step 1: Get fieldname nodes into the story river with links
Here’s a screenshot from my working demo, in edit mode. (Note that fieldnames that do not exist as tiddlers render in italics, as per our existing convention.) Hovering over a fieldname such as color
will show a tooltip for that field, so long as the fieldname tiddler exists and has a field-description
field:
The key edits here are to $:/core/ui/EditTemplate/fields — both to make fieldnames into links, and to offer a tooltip on hover, based on the fieldname tiddler’s field-description
field.
Step 2: Make fieldname tiddlers (or virtual nodes) informative
When you click the link for a fieldname, TiddlyWiki of course navigates you to the corresponding node — in this case, a node called color
.
In a barebones solution, you’d see the “missing tiddler” notice for a fieldname node where no corresponding tiddler exists.
In this case, however, let’s focus on color
. We know there is a tiddler called color
, because the link wasn’t italics — and it even displayed a tooltip based on its field-description!
The tiddler called color
is the natural place to make substantive notes about your use of this field, and it also might offer a more-or-less automatic “x-ray” of the wiki with attention to the color
field, leveraging has<storyTiddler>
or similar filter steps. Again from the working demo:
To get such effects, you can approach particular fieldname tiddlers one by one, or just set up a view template. Such a template can be as powerful and detailed as you like (perhaps nested with conditions, like “Ok, but let’s not list all the values for a field here if it’s a textarea field, right?”), or minimalist yet informative.
Step 3: Tweak dynamic tables, etc.
Of course, fieldname tiddlers can exist without shiraz dynamic tables. But dynamic tables are a fantastic help in adding depth to fields.
So I’ve modified the default headers in Shiraz dynamic tables so that there’s an info link next to a column header if it corresponds to a fieldname whose tiddler does exist. Again, hovering on the fieldname info icon displays a tooltip with field-description, if available. See below screenshot:
Analogous solutions can be built for any other solution (such as refnotes) that leverages database-like interaction with fields.
Questions
These are such simple tweaks — maybe good for MyFirstPlugin™ — but there are questions worth answering:
-
Should the fieldname solution be “direct” or “indirect”?
- I like having plain-old fieldname tiddlers, like
bibtex-author
; this direct solution makes this whole approach so simple! In a wiki that is friendly to data-entry users/authors, you could search for a fieldname, and there it is right in the regular search results. - But the “direct” solution wouldn’t be ideal for wikis with a layer of user-facing content that tries to hide TiddlyWiki guts. There could also be awkward results for novice users, who might naively create a field such as
library
— a fieldname that the core uses… - So… I could build in an option so that the fieldname
bibtex-author
actually directs us to$:/MyFieldnames/bibtex-author
… so that the technical info about fields isn’t distracting from tiddlers that are more relevant to viewer-facing content. (The option would be awkward to toggle “in action” though — a wiki will have to choose a style of wrangling, and stick to it.) - Please note this issue has gotten some useful discussion in the thread Tones started, beginning from this post, so maybe I should de-emphasize it in this thread, though it’s obviously important!
- I like having plain-old fieldname tiddlers, like
-
Should users have fine-grained option to enable/disable “missing” fieldname links? (Should this be handled separately from the existing $:/core/ui/ControlPanel/Settings/MissingLinks (Enable links to missing tiddlers), or just governed by that same preference (my inclination)?
- Also, perhaps there’s a shadow list of fieldnames to avoid linking-up, by default? (Maybe we suppress links to fieldnames for “standard fields” and/or “fields used by the core”?)
-
What do you all think are the essential or most exciting fields about fields? Obviously we don’t all have to be in lockstep, and I want this package to be nimble… Still, some “best practices” would be great to model.
- Something like
field-description
is the most important. (I’m not usingdescription
as the fieldname, since it’s in the core for a somewhat different purpose. Also naive users may really want to use it in predictable ways.) -
is_textarea
or something like that can nicely trigger better handling of extended text wherever that field is edited or displayed in a dynamic table, etc. -
is_list
could do something similar to facilitate list-handling, whileis_date
andis_color
could trigger relevant custom edit-field and view-mode formatting. One could imagineautocomplete_values
:yes
as a setting that can be made at the field-tiddler level. - We might inch toward all sorts of powerful field-specific handling, once fieldname tiddlers have a “there” there:
is_temporary
might mark a whole field as to-be-bypassed on save, even while the tiddler gets saved;author_only
might trigger css that suppresses all visibility for a certain field, even in edit mode, for those who are not logged in or accessing via file:// protocol (etc.);stealth_modify
could (in theory) allow any modifications to a given field to happen as if timestamps are off…
- Something like
Input welcome!