I am building a way to import into a permanent json tiddler, and subsequently extract the tiddlers.
I am building the extract process now and went to use the WidgetMessage: tm-perform-import
It seems that this message automatically deletes the source tiddler. Is there any way to override this behaviour?
Alternatively I could clone this to a new widget eg tm-perform-extract that does not delete the source tiddler.
Thank in AdvanceTony--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/a4ed7117-404e-4566-b34f-0ecefbdc9dd7%40googlegroups.com.
This is really part of the discussion about unrolling some internal logic so that it is expressed in wikitext, and can be more easily customised.
It’s important to understand that the $:/Import tiddler must conform to the format of a plugin, it’s not a generic JSON tiddler. It’s a temporary holding cell for incoming tiddlers. Note that it holds the tiddlers that are to be imported, not the original data that was dropped.
With that out of the way, the actions of handlePerformImportEvent are:
1. Import those tiddlers where field named “selection-“ plus the title of the tiddler does not contain the string “unchecked”. So the field “selection-HelloThere” is used to hold the status of the checkbox next to the tiddler “HelloThere”.2. Replace the $:/Import tiddler with a report of which tiddlers were imported3. Navigate to $:/Import4. Trigger an autosave event
It seems that this message automatically deletes the source tiddler. Is there any way to override this behaviour?Not at present, but we could conceivably add parameters to the message that allow finer control over the actions performed.
As ever, you’d be best making a plan that doesn’t require core modifications up front. In this case, that means making a plugin that does the new stuff, if necessary copying and pasting code from the core.