Creating a new tiddler with fields and adding a button to the view template

635 views
Skip to first unread message

Sam Drost

unread,
Apr 24, 2015, 5:55:47 PM4/24/15
to tiddl...@googlegroups.com
I see in the documentation that the new tiddler message can take a paramObject that is a hashmap of fields the new tiddler can have. What does the hashmap look like, and is there a way I can add a button to the view template that will create this tiddler with the current tiddler as a tag (like the create here button).

Jed Carty

unread,
Apr 24, 2015, 6:50:20 PM4/24/15
to tiddl...@googlegroups.com
Unfortunately my answer to the first part of your question is 'I don't know', but I do have an alternate solution.

I have never figured out how to use the new tiddler message like that, I have always used the action-setfield widget instead.

Because my brain doesn't want to focus on actual work today, I wrote a bit about how to make the button here. It kinda rambles a bit, but it should cover what is needed.

If anyone can tell us how to use the paramObject as an input to the tm-new-tiddler message that would be awesome.

Jeremy Ruston

unread,
May 4, 2015, 4:16:44 PM5/4/15
to TiddlyWiki, Sam Drost
Hi Sam

> I see in the documentation that the new tiddler message can take a paramObject that is a hashmap of fields the new tiddler can have. What does the hashmap look like, and how do I add a button to the view template that will create this tiddler with the current tiddler as a tag (like the create here button).

From wikitext you can specify the fields of the hashmap as attributes of the <$action-sendmessage> widget. For example:

<$button>
<$action-sendmessage $message="tm-new-tiddler" my-field="123" modifier="Joe Bloggs"/>
Demo
</$button>

Best wishes

Jeremy.


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6a34aae6-b231-467d-992a-7e542e4fe0a6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com
Reply all
Reply to author
Forward
0 new messages