The horizontal view is very good for sorting idea’s so it would be perfect to be able to sort them by drag and drop. I tried to implement this in the storyriver ($:/plugins/krystal/story) there.
But somehow the currentTiddler-Variable seems to be empty so that the actionTIddler always appears at the end.
Any ideas how to debug this?
You need a separate droppable widget around each tiddler in the story, where the current tiddler variable is set to the value of that tiddler.
Similarly you need a separate draggable widget around each tiddler in the story if you want them to be directly draggable, and the tiddler attribute of the draggable widget needs to be set to the title of that tiddler.
I have already used a lot of clumbsy contructions like <$list filter="[currentTiddler]" template="$:/core/ui/StoryTiddlerTemplate"/> to get the correct formatting but nothing worked.
I think the problem is just that the HTML structure of the tiddlers is no longer the same after wrapping the draggable and droppable widgets and therefore the CSS is not being properly applied.
Two possible ways to approach it. Modify the tidder template and place the draggable and droppable widgets inside it. Or modify the CSS to work with the new HTML structure. The latter would probably be more robust.
Hi Saq, thanks a lot. But I did not make any advances:
Taking your first approach and fiddling in the droppable into a new $:/plugins/krystal/StoryTiddlerTemplate again the krystal-specific formatting is lost.
The css is hard to reverse-engeneer because some of the classes seem to be applied by js.
What is astonishing me is that here<$transclude/> does not create a working dropzone whereas {{||$:/core/ui/StoryTiddlerTemplate}} does… Could this be a question of tags?
You need the droppable widget inside $:/core/ui/ViewTemplate or a clone of it that you use as the view template.
The problem really is that the JS and CSS depend on a particular HTML structure, and we need to change the HTML to get the drag and drop behaviour that you want. I cannot say more without taking the time to deconstruct the plugin and honestly it might at that stage be easier to start from scratch.
Seems you are right: Even inserting the droppable deep down in the $:/core/ui/ViewTemplate destroys the html in a way that the Krystal css are no longer working.
Cool! Thank you! I made a version where I turn only the left edge (pink for demo purposes) of the Tiddlers and the titles into dropzones. What do you think is better?
It is hard to say without playing with and seeing what is useful in practice.
I do suggest not using a draggable widget around each tiddler though, and using the tiddler titles as the thing to drag. The problem with making the entire tiddler draggable is that it becomes impossible to select text inside them.