How to display/list all fields in tiddler description ?

742 views
Skip to first unread message

Etienne

unread,
Jun 14, 2020, 3:00:14 PM6/14/20
to TiddlyWiki
Hi !

I'd like to use tiddler as a kind of database, meaning quite a heavy use of fields.

Creating custom fields is easy enough, but I can't find a way to display them (and their contents) in a simple way.

Meaning :


Let's say I've got user-fileds such as "name", "age" and "size" in a tiddler called "John Smith".

Is there a way to get those fields in the tiddler's text in a easier way than the following method ??

''Name :'' {{!!name}}

''Age :"" {{!!age}}

''Size :"" {{!!size}}


The main idea is then to create a "Create character" button or keyboard shortcut that would create a new tiddler with those fields preactivated (but empty) and a shortcode in the text area that would display them this way.

TW Tones

unread,
Jun 15, 2020, 8:39:36 AM6/15/20
to TiddlyWiki

The quick answer is yes. You can makes templates with fields, list fields in the current tiddler and use a view template to display fields and there values even without any thing in the text field.

Unfortunatly it's near my bed time and I am on my mobile I can share more tomorrow.

Night
Tony

Paco Rivière

unread,
Jun 16, 2020, 6:55:37 PM6/16/20
to TiddlyWiki
May these be usefull?:




El diumenge, 14 juny de 2020 21:00:14 UTC+2, Etienne va escriure:

TW Tones

unread,
Jun 16, 2020, 9:09:15 PM6/16/20
to TiddlyWiki
Etienne

There is a lot of information on tiddlywiki.com see https://tiddlywiki.com/#FieldsWidget

It also provides include and exclude options, but needs examples, some of which are already built into tiddlywiki.

You ca also use the
fields[]
operator

In the info tab of each tiddler there is a fields tab. This is the tiddler 

$:/core/ui/TiddlerInfo/Fields

Place this in a tiddler

<$transclude tiddler="$:/core/ui/TiddlerFields"/>

WHich means you can plce this

{{||$:/core/ui/TiddlerFields}}

in your tiddler or a tiddler tagged $:/tags/ViewTemplate


But if you open $:/core/ui/TiddlerFields you can see what is being done
<table class="tc-view-field-table">
<tbody>
<$list filter="[all[current]fields[]sort[title]] -text" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
</tbody>
</table>

By the way a lot of people use tiddlywiki for game references and characters, I am sure you could find one already built.

See tiddlywiki5 in discord especially tw-for-gaming

Regards
Tony
Reply all
Reply to author
Forward
0 new messages