Prevent a button from overwriting tiddlers.

42 views
Skip to first unread message

vinvi...@gmail.com

unread,
Jan 7, 2021, 6:08:59 AM1/7/21
to TiddlyWiki
Hello,

This button will overwrite an existing tiddler. How do I make sure that if the tiddler already exists it is numbered? If "Tiddler1" already exists, it becomes "Tiddler2".


\define BUTTON-NAME() Enter >
\define BUTTON-COLOR+SIZE() btn btn-link btn-sm
\define BUTTON-TEXT-COLOR() color:
\define TIDDLER-TITLE() $(currentTiddler)$ SPECIFIC
\define TIDDLER-TEMPLATE() {{||$(currentTiddler)$-SPECIFIC-TEMPLATE}}


<$button type="button" class=<<BUTTON-COLOR+SIZE>>>
<$set name=mytags filter="[subfilter{!!tiddler-tag-button}]">

<$action-sendmessage $message="tm-new-tiddler"
title=<<TIDDLER-TITLE>>
text=<<TIDDLER-TEMPLATE>>
load-description-button="{{||Description-button}}"
tags=<<mytags>>/>
</$set>
<span style=<<BUTTON-TEXT-COLOR>>><<BUTTON-NAME>></span>
</$button>
<<mybutton>>


Thank you,

PMario

unread,
Jan 7, 2021, 11:34:57 AM1/7/21
to TiddlyWiki
Hi,
Have a closer look at: https://tiddlywiki.com/#ActionCreateTiddlerWidget and the examples!
-m
Reply all
Reply to author
Forward
0 new messages