How to use action-delete-tiddler in a list widget?

52 views
Skip to first unread message

David Gifford

unread,
Jan 6, 2021, 5:19:22 PM1/6/21
to TiddlyWiki
Hi everyone

I have a list widget for tasks, and I would like to have a way to delete tiddlers in the list.

I tried

<$list filter="[!is[system]all[current]tagging[]sort[title]]"><$button class="tc-btn-invisible tc-tiddlylink"><$action-deletetiddler /><<icon {{$:/core/images/delete-button}}>></$button><$link><$view field="title"/></$link><br></$list>

and

<$list filter="[!is[system]all[current]tagging[]sort[title]]"><$button class="tc-btn-invisible tc-tiddlylink"><$action-deletetiddler  $tiddler="[is[current]]" /><<icon {{$:/core/images/delete-button}}>></$button><$link><$view field="title"/></$link><br></$list>

Nothing happens with either of these.

Thanks in advance for your help!

TW Tones

unread,
Jan 6, 2021, 5:54:05 PM1/6/21
to TiddlyWiki
David,

It is a lot easier than you think, try this on tiddlywiki.com

<$list filter="[tag[TableOfContents]sort[title]]">{{||$:/core/ui/Buttons/delete}} <$link/><br></$list>

I use a different filter for relevance, just transclude the actual button tiddler, not the image and make sure you use "||" in the transclusion to ensure it applies to the current tiddler.

In any list where the currentTiddler varies you can transclude any button from the View or edit toolbar (if relevant) . Attached is a small set of tiddlers that help copying button tiddlers to test to use.

Regards
Tones
copy-buttons-set.json

Mark S.

unread,
Jan 6, 2021, 6:01:25 PM1/6/21
to TiddlyWiki
The documentation says that the $tiddler attribute is optional. It appears to be mandatory. So set $tiddler=<<currentTiddler>> (inside of action-deletetiddler) and it should work.

TW Tones

unread,
Jan 6, 2021, 6:12:04 PM1/6/21
to TiddlyWiki
Mark,

Yes there a few cases of this, including a mismatch in when to use $ and not $

My approach bypasses this by using already working buttons.

Tones

David Gifford

unread,
Jan 6, 2021, 6:15:27 PM1/6/21
to TiddlyWiki
Thank you TW Tones and Mark S!

TW Tone's solution works great. Blessings,
Reply all
Reply to author
Forward
0 new messages