list-links-draggable with templates

152 views
Skip to first unread message

Luis Gonzalez

unread,
Jul 25, 2019, 4:53:06 AM7/25/19
to TiddlyWiki
I have a wiki for planning stories,

The first problem:
Each story tiddler, for example "A big trouble" has a list-links-draggable to dragg scenes in it with this code:

<<list-links-draggable tiddler:"A big trouble" type:"ol" itemTemplate:"scene_template">>

You can see that the tiddler with the list field (the same tiddler) is hard-coded (in red). I need to put something more general, for example tiddler=<<currentTiddler>>.




The second problem:
You can see that there is a delete button on the right of the scene title to delete the scene from de current story. This delete button does not work. It is in the tiddler "scene_template" that has the code:

<$link><<currentTiddler>> </$link>
<$button>
<$action-listops $subfilter="+[remove<currentTiddler>]" />
{{$:/core/images/close-button}}
</$button>

Whats wrong?
Whats the code to remove the <<currentTiddler>> to the field "list" of the tiddler "A big trouble"?

The attached file contains the basic tiddlers.

empty.html

TonyM

unread,
Jul 25, 2019, 7:31:09 AM7/25/19
to TiddlyWiki
Luis

Your first step is to call the macro using the macrocall widget instead because you can pass parameters like this param=<<varname>> or param={{tiddlername}} param={{!!fieldname}} etc...

Regards
Tony

Message has been deleted

Luis Gonzalez

unread,
Jul 29, 2019, 4:33:20 AM7/29/19
to TiddlyWiki
I got it!!!!. I have a draggable zone to insert scenes in a story with a way to delete a scene from the story!!. Please, take a look at the attached file. It's a list without bullets or numbers.

How can I make a numbered list of the draggable list on each story?? The list-tagged-draggable macro has not a type parameter (list type) as the list-links-draggable macro.

The code in each story:
<$vars actual=<<currentTiddler>> >
<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>> itemTemplate="scene_template"/>
</$vars>

The scene_template code:
<$checkbox tag=<<actual>> > <$link><<currentTiddler>> </$link>
</$checkbox>


I need a numbered list in the list generated by the list-tagged-draggable macro. This is the scene list of the story "A big trouble":


You can put <li> in the template, but is an unordered list.

empty.html

Luis Gonzalez

unread,
Jul 29, 2019, 5:21:11 AM7/29/19
to TiddlyWiki
I found it.

The Story code:
<$vars actual=<<currentTiddler>> >
<ol><$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>> itemTemplate="scene_template"/></ol>
</$vars>

The scene_template code:
<li><$checkbox tag=<<actual>> > <$link><<currentTiddler>> </$link>
</$checkbox></li>

Thats all.
Thanks!!
Reply all
Reply to author
Forward
0 new messages