[TW5] assign value to fields on tw-new-tiddler action or similar action when creating a new tiddler from a template

727 views
Skip to first unread message

ruddb

unread,
Mar 6, 2014, 9:15:22 PM3/6/14
to tiddl...@googlegroups.com
I am using a template tiddler with a preset field, then this template tiddler is used on a tw-new-tiddler action from a button. 
However I want to pass the title value of the calling tiddler (where the button is) to the field of the new tiddler. 
Anyway to implement this?

One approach I am trying is this but it doesn't work or I just do not know how to implement a Template string for the fields widget.

\define newdisc()
<$fields tiddler="templateTest" template="" ><$set name="currentTiddler" value="templateTest"> <$button message="tw-new-tiddler" set="templateTest" setTo="test" param="templateTest" >New Task</$button></$set></$fields>
\end

Thanks and appreciate the reply.

Stephan Hradek

unread,
Mar 7, 2014, 12:33:10 AM3/7/14
to tiddl...@googlegroups.com
Did you see http://tiddlystuff.tiddlyspot.com
Search for Newtiddler Widget.

ruddb

unread,
Mar 7, 2014, 4:14:58 AM3/7/14
to tiddl...@googlegroups.com
Hi Stephan,

Trying it now and it works great! I was a bit hesitant to use some plugins because of bad experience from D3 to TW5 migration so I want to try to use core functions. Do you now if this widget type will go to the official release?

Thanks again.

Stephan Hradek

unread,
Mar 7, 2014, 5:31:37 AM3/7/14
to tiddl...@googlegroups.com
I do not know. You should ask Jeremy.

Jeremy Ruston

unread,
Mar 8, 2014, 5:58:56 AM3/8/14
to TiddlyWiki
Trying it now and it works great! I was a bit hesitant to use some plugins because of bad experience from D3 to TW5 migration so I want to try to use core functions. Do you now if this widget type will go to the official release?

The plan is to allow templating of skeleton tiddlers as part of broader support for literal tiddlers. In the meantime you should feel free to use Stephan's plugin; you can protect yourself against changes to the syntax by wrapping the widget in a macro that encapsulates your own common use cases.

Best wishes

Jeremy.



 

Thanks again.


On Friday, March 7, 2014 12:33:10 PM UTC+7, Stephan Hradek wrote:
Did you see http://tiddlystuff.tiddlyspot.com
Search for Newtiddler Widget.

--
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.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

ruddb

unread,
Mar 8, 2014, 7:53:38 AM3/8/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Thanks for the advise. I have implemented it inside a macro as you mentioned. Looking forward to the next release.

Michael

unread,
Jun 29, 2014, 6:32:03 PM6/29/14
to tiddl...@googlegroups.com
Hi ruddb, Stephan,

I seem to have a similar problem: I want to create a template with a 'new tiddler' button. The value for param should come from a field in the calling tiddler. I am not very experienced with the TW5 syntax, so in my naiveté I tried param={!!field}, but this does not work. I also tried to use Stephan Hradeks newtiddler plugin, using <$set> to set the values of tags and fields in the new tiddler, but if I want to do that dynamically using fields of the calling fiddler, I fail.

How do you get it to work?
Michael

Stephan Hradek

unread,
Jun 30, 2014, 12:39:53 AM6/30/14
to tiddl...@googlegroups.com
param={{!!field}}



You missed one {} level

Matabele

unread,
Jun 30, 2014, 1:17:10 AM6/30/14
to tiddl...@googlegroups.com
Hi Michael

I have written a set of widget plugins to enhance the functionality of buttons -- they may be found here: http://gwiz.tiddlyspot.com/

The example given for the <$maketid> widget sounds similar to your usage case, but there are a number of ways of achieving this -- have a look at the demos for ideas.

Values from fields in the current tiddler may be accessed with the syntax:

attribute={{!!field-name}}

This syntax refers to the value of a field in the current tiddler -- to access the value of a field in another tiddler, use this syntax:

attribute={{TiddlerTitle!!field-name}}

regards

Michael

unread,
Jun 30, 2014, 10:07:22 AM6/30/14
to tiddl...@googlegroups.com
Thanks so much, Matabele and Stephan! You made my day!

Best regards,
Michael

Michael

unread,
Nov 1, 2014, 5:25:22 AM11/1/14
to tiddl...@googlegroups.com
Is there a way to assign several different actions to a button?

Example: Clicking a button sets field value y to y1 but also sets field value x to x2 (would come very handy for self-made popups that close after use)

Another example that I do not get to work: Create a new tiddler with title x, fields + values x, y, z plus tags x, y, z. I know that this is possible by using a template tiddler (essentially cloning the template), but if the template tiddler does not exist, an empty tiddler is created instead.

These are two use cases that I cannot get to work!

Thanks again for your help!
Michael

Evolena

unread,
Nov 1, 2014, 5:59:21 AM11/1/14
to tiddl...@googlegroups.com
Maybe look at actionWidgets : http://tiddlywiki.com/#ActionWidgets
There will be an action-setField-widget in the forthcoming 5.1.5 version (see https://github.com/Jermolene/TiddlyWiki5/blob/master/editions/prerelease/tiddlers/ActionSetFieldWidget.tid for the associated documentation)

Matabele

unread,
Nov 1, 2014, 11:23:18 AM11/1/14
to tiddl...@googlegroups.com
Hi

I wrote a number of button widgets some time ago for the beta versions of TW5 which address the problem you are having -- they may be found here: http://gwiz.tiddlyspot.com/

Their functionality has largely been superseded with the new action widgets -- especially once the forthcoming ActionSetfieldWidget widget of version 5.1.5 is included.

I have delayed updating my button widgets as I do not see any need to duplicate the functionality now included with action widgets. Once I have experimented with the action widgets, I might update and modify my widgets to address any missing functionality and synchronise their mechanism with action widgets.

regards

Michael

unread,
Nov 3, 2014, 4:24:32 PM11/3/14
to tiddl...@googlegroups.com
Thank you @Evolena and @Matabele for pointing out the action widgets to me. I did not have time so far to check out 5.1.4, I am still living in 4.1.3!

I will have to wait for the ActionSetFieldWidget, or if I get too inpatient,  I will try Matabeles Setfield Widget :-).

All the best,
Michael
Reply all
Reply to author
Forward
0 new messages