I think this is basically what SuperTag plugin, auto-generate a field editor on view template is for. The domain is now SuperTag.
That’s an interesting tool, but I think it’s for a different purpose.
The demo you shared seems to be chiefly about editing fields. Is there an internal delegation model that I’m missing?
My thought – which might be handled other ways, as seen in this discussion – was that there might be a way for a tiddler than inherits from another tiddler to only override the fields it cares about. Any field it doesn’t override is retrieved from the parent. Thus if I delete a field in a child tiddler, and try to use that field, it once again gets the parent’s value.
(I have the impression that you’re a JavaScript person. Is that correct? If so, this is very similar to JS’s prototypal inheritance model.)
As @jeremyruston pointed out, this might be logically sound, but it is far too different a model from the current one to ever really have a chance of making the core. But the answer from @Brian_Radspinner shows a way I might achieve the desired effect.
Look at the Task tiddler, If you create a new tiddler and add Task as tag to it, you will find the new tiddler inherit the fields defined in the Task.
This is because Task is a SuperTag, that bring specific set of field to its child tiddler.
You can get this from the readme in the demo site.
In supertag system, child inherit fields from SuperTag, but not inherit acturial values, is this what you mean?
I don’t know many use case of inherit values, but i think inherit fields form the tag will make it easier to edit todo task tiddler.
In supertag system, child inherit fields from SuperTag, but not inherit acturial values, is this what you mean?
Yes. Here’s what I was imagining;
You clone my wiki to make your own chemistry studying tool. You edit, say, the Chlorine
tiddler, which is a shadow tiddler, but instead of of the current Clone mechanism, you use my imaginary Inherit one. Your new tiddler has no fields except for one specific name dedicated to inheritance, let’s call it __proto__
.
But if you try to fetch the atomic-mass
property of your new tiddler, the system still finds the value of 35.453
, because if the property is not on your tiddler, it will be looked up on the parent tiddler (the shadow tiddler Chlorine
.) When you set a value, it is set directly on your tiddler. Perhaps your own research convinces you that Chlorine was discovered centuries earlier, by Muḥammad ibn Mūsā al-Khwārizmī, and you set the discoverer
to al-Khwārizmī
and the year to 823
. These values are on your inherited tiddler.
Later, you discover that this was Ottoman propaganda. al-Khwārizmī was an astronomer and mathematician. He didn’t do any serious chemistry.
To fix this, you don’t try to recall and reset the old values of year
and discoverer
. Instead, you simply delete those fields on your own tiddler. And the underlying values are once again available. If you check [[Chlorine]get[year]]
it will now report 1774
and [[Chloring]get[discoverer]]
will report Scheele
… because those are the values on the prototype (shadow) tiddler.