Hi Si,
Thank you for clarification; however, I think the approach is still valid and demonstrated how it works, and with minor adjustments you can have field templates across source types;
(1) Make tiddlers with
- title starting with "$:/template",
- a field tiddlertype, for example tiddlertype: book,
- a field standardtext, for example standardtext: {{||$:/view/book}}, and
- required (empty) fields, for example booktitle and genre
(2) Make
- title starting with "$:/fieldtemplate", and
- text with how the field should be edited, eg.
-- A tiddler $:/fieldtemplate/booktitle with text: Title: <$edit-text field="booktitle" />
-- A tiddler $:/fieldtemplate/genre with text: Genre: <$select field="genre"><option>Horror</option><option>Poetry</option><option>Screenplay</option></$select>
(3) The add/edit tiddler can be
\define tiddlername() {{!!tiddlertype}}: <<now "YYYY-0MM-0DD 0hh:0mm:0ss" >>
\define fieldtiddler() $:/fieldtemplate/$(currentFieldTiddler)$
<$list filter="[title[$:/temp/edit]!has[text]]">
<$list filter="[prefix[$:/template]]">
<$button>
<$wikify name=newtiddlername text=<<tiddlername>> >
<$action-createtiddler $basetitle=<<newtiddlername>> text={{!!standardtext}} tiddlertype={{!!tiddlertype}} />
<$action-setfield $tiddler="$:/temp/edit" text=<<newtiddlername>> />
</$wikify>
Create {{!!tiddlertype}} Tiddler
</$button>
</$list>
</$list>
<$list filter="[title[$:/temp/edit]has[text]get[text]]" variable="edittiddler">
<$set name=tiddlertype filter="[title<edittiddler>get[tiddlertype]]">
<$list filter="[prefix[$:/template]tiddlertype<tiddlertype>fields:exclude[list title text tags created modified]]" variable="currentFieldTiddler">
<$tiddler tiddler=<<edittiddler>> >
<$transclude tiddler=<<fieldtiddler>> mode="block"/>
</$tiddler>
</$list>
</$set>
<$button>
<$action-deletetiddler $tiddler="$:/temp/edit"/>
Ok
</$button>
</$list>
Now, the form is populated with the corresponding fieldtemplates derived from the fields in the tiddler template. If the same field name is used in another tiddler template, the same field template is used
I provide a working example so that you, but most importantly others who perhaps is searching for similar solutions, can test and play around
Best,
Anders