According to https://tiddlywiki.com/static/Table-of-Contents%20Macros.html , when building a ToC, the value of the list
field of a tiddler can be used to order its children. Editing the value of this list
field becomes a giant pain as it grows. Especially when there are long, multiword tiddler titles. I’d rather have this whole list stored as a separate tiddler (in its text
field) so I could just use the tiddler editor to modify it, and have its value inlined in the tiddler with the list
field, in the spirit of transclusion. Is transclusion in field values possible at all, are there examples to learn from? Is this even the correct and easiest way to solve the original problem?
May be my Multi Line Field Editor plugin may be an option?
It depends on the Field Visibility plugin. So both of them are needed. If you use the official import plugin mechanism the dependency will also be imported.
An other easy way would be to us the <<tag "your-tag">>
macro. It will create a dropdown, which can be used to drag & drop sort the list-field order.
Drag-and-drop is my nemesis on mobile. But I’ll try the plugin suggestion above right now and report back.
Ok, I figured how to install the plugin and how to make it work. This lets me edit the field value in a more convenient way, so it solves my direct problem.
There’s only one thing that I don’t understand. Why do I have to manually create the field switcher element for the field that I want to edit using the plugin? I’d expect this to be handled automatically, as in when I open a tiddler in edit mode, the field switcher gets autopopulated for all fields that the tiddler has.
Also, I think there’s a small typo in the GettingStarted
tiddler of the plugin:
s/Imporant/Important/
The second half of my original question still remains open: why can’t I just have something like {{OtherTiddler}}
as field value? Is this not supported? If this would be possible, I could just edit OtherTiddler
the usual way and would not need a special field editing plugin at all.
If I understand your problem, checkboxes might be an alternative to avoir Drag&Drop.
I already used this trick for an equivalent problem, but I don’t have the code with me for now, so I’ll just explain the logic.
So, you already have your original list-field with each element in random/default order.
Use a list widget to generate a list of checkboxes from each element in the list.
Each checkbox will be in list mod and add its value to the same second list-field.
The order the boxes will be checked will determine the order of the elements in this second list-field.
Then, for your ToC, you will need to use a conditional reveal.
If “Second list-field” is not empty, display a ToC generate from it.
Else, display a ToC generated from the original list-field.
This will avoid using Drag&Drop.
The main reason is, that multi-line fields will also change the behaviour how a Node.js wiki will save tiddlers. As soon as a field has a line-break, the tiddler has to be saved as a .json
file and a .meta
file. That’s a general TW behaviour. Not from the plugin.
I do not want that to happen accidentally, which would be possible if all fields would be enabled automatically.
Users have to “intentionally” define a configuration which enables the field editor. If there is a configuration nobody can say: “Your plugin accidentally did this or that.”
You can have {{OtherTiddler}}
in a field. But the UI that uses this field value has to know, that there is a transclusion instead of a “title list”. The logic to handle the list-value needs to be different. The core can not handle the list-filed in that way.
Changing that behaviour will cause a backwards compatibility problem, because no existing 3rd party code would be able to handle a new behaviour.