I am wondering What would be the best way to allow each tiddler, or part there of, to be a custom drop zone?.
Basically when we drop tiddler title, links or other content on a tiddlywiki it invokes the import mechaisium. It would be useful if we could customise various tiddlers so they act as drop zones to treat such drops differently.
Examples
I would like to open a tiddler add drop links on it, rather than invoke the import mechaisium if what is being dropped begins “http” could be added as a field eg “link 1” “link 2” containing the URL. This would allow a specific tiddler to be used to collect relevant links. A separate view template would make the links available on that tiddler.
In another example I would like to drop text on a tiddler and have it appended to the text field.
I would be interested in creating a mechaisium for example where a tiddler containing a field “drop-actions” value “<<add-linkactions>>” the whole tiddler would become a drop zone where the “<<add-linkactions>>” macro responds to the dropping of content.
I would appreciate any ideas on how to achieve this.
@stobot I expect the solution will use the widgets you point to. My question is how do I get the tiddler to be that “drop area”, and respond to a field containing the drop actions?
How would you do it?
Do we have to edit part of the page/story/viewTemplate mechanism’s or can we apply something to particular CSS class or ID?
All I need now is to determine how best to make the whole tiddler the drop zone.
Try this:
Edit shadow tiddler $:/core/ui/ViewTemplate
add \define drop-actions() {{!!drop-actions}} on a line after \whitespace trim
add <$droppable actions=<<drop-actions>>> on a line before <$list filter=...>
add </$droppable> on a line after </$list>
In the drop-actions FIELD, add whatever <$action-*> widgets you want. You can use <<actionTiddler>> to refer to the “payload” tiddler title and <<modifier>> to get the name of the modifier key, if any (one of: normal, ctrl, shift or ctrl-shift)
Note that the above change to the ViewTemplate includes all the tiddler elements (the title, tags, body, etc), but does NOT include the outer tc-tiddler-frame.