The $dropzone
widget used to trigger drag-and-drop $:/Import handling is defined in $:/core/ui/PageTemplate
:
<$dropzone enable=<<tv-enable-drag-and-drop>>>
which also defines the tv-enable-drag-and-drop
variable, which gets itâs value from the contents of $:/config/DragAndDrop/Enable
, and has a default value of âyesâ.
To disable the default $dropzone, create a tiddler named $:/config/DragAndDrop/Enable
, with a text field value of ânoâ. After doing this, you will no longer be able to use drag-and-drop to import tiddlers.
You will still be able to use the âImportâ PageToolbar button (see the sidebar âToolsâ tab, or $:/ControlPanel > Appearance > Toolbars > Page Toolbar
settings) to initiate a âbrowse for fileâ system dialog to import tiddlers from locally saved .JSON files.
You can define your own custom dropzone âhotspotâ by creating a tiddler containing something like
<$dropzone>drop here to import tiddlers</$dropzone>
When that tiddler is displayed, you can then drag-and-drop onto the âdrop here to import tiddlersâ text to initiate the TWCoreâs usual $:/Import handling.
To add a nice visible âimport tiddlersâ $button interface into the SideBar, try this:
- Create a tiddler (e.g., SidebarImportZone)
- Enter text content:
<$dropzone><$button>drop here to import tiddlers</$button></$dropzone>
- Tag it with
$:/tags/SideBarSegment
- Add a field named âlist-beforeâ with a value of
$:/core/ui/SideBarSegments/tabs
Important note: Setting $:/config/DragAndDrop/Enable
to ânoâ also disables use of drag-and-drop for re-ordering items within tag dropdowns.
To avoid this side-effect, instead of setting $:/config/DragAndDrop/Enable
to ânoâ, you can disable the drag-and-drop $:/Import handling by editing the $:/core/ui/PageTemplate
shadow tiddler and completely removing the <$dropzone ...>
and </$dropzone>
widgets from that tiddler. This leaves the tag dropdown handling intact, while still preventing page-wide drag-and-drop $:/Import handling from being triggered.
enjoy,
-e
Okay, now that Iâm back from slamming my forehead against a door frame for not having brought this up earlierâŚ
Thank-you much, Eric !
Does that ever make a huge difference. Iâm sure thatâs going to help me immensely, and Iâm going to set that up in all my TiddlyWiki instances.