[TW5] WidgetMessage: tm-new-tiddler vs ActionCreateTiddlerWidget

138 views
Skip to first unread message

TonyM

unread,
Apr 7, 2018, 4:16:20 AM4/7/18
to TiddlyWiki
Folks,

Can any one please assist me re: WidgetMessage: tm-new-tiddler vs ActionCreateTiddlerWidget ?

Best so far
I am using a Button with WidgetMessage: tm-new-tiddler because this also navigates to the new Tiddler with the title field ready named "default title" to edit. 
However unless I rename the new tiddler, the second click of this button simply reopens the "default title" and will not increment the title and create a new tiddler.

First
I was using the ActionCreateTiddlerWidget and it would create a new tiddler "default title" but not navigate to it and open it in edit mode. 
However the second click of this button would create a new tiddler "default title 1" but once again not navigate to it.
I tried some further actions to navigate to the tiddler in edit mode on creation but I could not seem to get it to work

How can I get the best of both worlds?
Which would be the Best so Far but if a tiddler of that name exists increment the title before opening it for edit.

Thanks in advance
Tony

PMario

unread,
Apr 7, 2018, 5:24:50 AM4/7/18
to TiddlyWiki
Hi,

Navigate to the newly created tiddler:


\define actions()
<$action-createtiddler $basetitle="Homemade Button" $savetitle="$:/temp/test"/>
<$action-navigate $to={{$:/temp/test}}/>
\end

<$button actions=<<actions>>>
Create new tiddler
</$button>


Edit new tiddler:


\define actions()
<$action-createtiddler $basetitle="Homemade" $savetitle="$:/temp/test"/>
<$action-sendmessage $message="tm-edit-tiddler" $param={{$:/temp/test}}/>
\end

<$button actions=<<actions>>>
Create new tiddler
</$button>

Details: https://tiddlywiki.com/#WidgetMessage%3A%20tm-edit-tiddler:%5B%5BWidgetMessage%3A%20tm-edit-tiddler%5D%5D%20ActionNavigateWidget%20ActionCreateTiddlerWidget

have fun!
mario

TonyM

unread,
Apr 7, 2018, 5:28:38 AM4/7/18
to TiddlyWiki
Thanks Mario,

It the save title trick I did not know.

Regards
Tony

PMario

unread,
Apr 7, 2018, 6:40:31 AM4/7/18
to TiddlyWiki
On Saturday, April 7, 2018 at 11:28:38 AM UTC+2, TonyM wrote:
It the save title trick I did not know.

I just found it out myself. ... I did have a similar problem some time ago ... and I thought, there must be an existing solution. ... And today with some luck, I found an easy way :)

-m

Reply all
Reply to author
Forward
0 new messages