I was able to hack together a custom ViewTemplate section for the $:/Import 
tiddler (or any tiddler with `plugin-type[import]`) that will do this, but 
it requires my JsonMangler plugin to be installed. The attached tiddler 
adds a tag-pill with "DROP TAG-TITLE HERE" on it to the $:/Import tiddler. 
The tag-pill is wrapped in a $droppable widget that invokes the actions to 
add (or remove with the SHIFT key held down) the title of any tiddler-link 
dragged onto it to ALL tiddlers waiting to be imported. *phew*

The roadblock to doing this in vanilla TW is that you cannot address nested 
JSON (which is what a plugin/import tiddler is). So you have to install my 
JsonMangler plugin from here:

https://joshuafontany.github.io/TW5-JsonMangler/

And then drag and drop the attached json file with the ViewTemplate into 
your wiki. Import a bunch of tiddlers (for example, the attached 
"tiddlers.json" which is a few document tiddlers from Tiddlywiki.com). Set 
the import options to view the Fields. Drag a tiddler-link (from the Open 
tab, or anywhere) onto the tag-pill.

All awaiting import tiddlers will have the tag added. Shift+Drag a 
tiddler-link (from the Open tab, or anywhere) onto the tag-pill. That title 
will be removed from the tags in the subtiddlers. I would have to work on 
the logic to selectively apply or remove the tag from only the Checked 
subtiddlers, but that would be a bit more complicated.

Best,

Joshua Fontany

On Friday, June 12, 2020 at 2:54:22 PM UTC-7, Saq Imtiaz wrote:
>
> If you're willing to write JavaScript, a far cleaner way is to use the 
> th-importing-tiddlers hook
>
>
> https://github.com/Jermolene/TiddlyWiki5/blob/d832cb93ce48f3cfaefb18809930e2448917bc93/core/modules/widgets/navigator.js#L559
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2297c1b1-196e-44da-ba35-a50351672ee7o%40googlegroups.com.

Attachment: tiddlers.json
Description: application/json

Attachment: $__CustomImport_ViewTemplate_AddTagDropzone.json
Description: application/json

Reply via email to