can I create a tiddler without it entering edit mode?

36 views
Skip to first unread message

andres....@gmail.com

unread,
Nov 21, 2021, 5:27:29 PM11/21/21
to TiddlyWiki
So doing a project and I am creating tiddlers no problem with the action-sendmessage widget with the tm-new-tiddler message. But I might have a need to be able to create a tiddler on button click that creates the tiddler "secretly". So it creates the tiddler but doesn't put it in the stream.
I tried sending a tm-save-tiddler and tm-close-tiddler after the tm-new-tiddler but nothing happens. I am guessing it's because it navigates away?
There are other ways I can skin this particular cat, but I am curious if my initial approach is possible.

Charlie Veniot

unread,
Nov 21, 2021, 5:44:46 PM11/21/21
to TiddlyWiki
G'day,

I haven't tried this with latest edition of TiddlyWiki, but you should be able to use the ActionSetFieldWidget to create a tiddler with a value in some field.

Set, say, the text field to some value.  If the specified tiddler does not exist, it should get created.

Eric Shulman

unread,
Nov 21, 2021, 5:45:35 PM11/21/21
to TiddlyWiki
You can use https://tiddlywiki.com/#ActionCreateTiddlerWidget or https://tiddlywiki.com/#ActionSetFieldWidget to create tiddlers without opening them in the Story Column.

enjoy,
-e

andres....@gmail.com

unread,
Nov 21, 2021, 6:17:43 PM11/21/21
to TiddlyWiki
Oh shoot! I've been using the ActionSetFieldWidget a bunch but only to modify fields in existing tiddlers. I completely missed that aspect of it. works perfectly! thank you both!

Eric Shulman

unread,
Nov 21, 2021, 8:11:26 PM11/21/21
to TiddlyWiki
Another handy use of ActionSetFieldWidget is to "clone" a tiddler, simply by setting the title field.

Let's suppose you have a Tiddler named "TidA", and you want to make a complete copy of it named "TidB".  You can achieve this via:
`<$action-setfield $tiddler="TidA" title="TidB" />`

While this *might* seem like it would rename TidA to TidB, what it actually does is to create a *new* tiddler named TidB with all the same fields and values as TidA, while leaving TidA itself unchanged.
If you actually do want to rename TidA instead of cloning it, you would use the above, followed by:
`<$action-deletetiddler $tiddler="TidA" />`

-e

andres....@gmail.com

unread,
Nov 21, 2021, 9:47:14 PM11/21/21
to TiddlyWiki
oh that's good too! I wound up using ActionCreateTiddlerWidget as I had wanted to have it copy a template tiddler and it was most obviously able to do so, but good to know about setfield as well. That rename bit, though, is also gold. need to squirrel that away! thank you!
Reply all
Reply to author
Forward
0 new messages