[TW5][Feature suggestion] Child color field autopopulate on 'New Here'.

88 views
Skip to first unread message

Hegart Dmishiv

unread,
Mar 15, 2016, 11:30:54 AM3/15/16
to TiddlyWiki
I'm often creating many child tiddlers using the "New Here" button, and setting their color manually, so that they match a given color scheme when used as tags. I just had the idea that I would like to be able to set the colors automatically by transcluding a field, such as {{parentTiddler!!color}}, which would be cool. But then I thought, what would be even better, is if the !!childcolor field exists on the parent tiddler, for it to automatically populate to the child tiddler's !!color field when generated using "New Here". Does that make sense?

Jed Carty

unread,
Mar 15, 2016, 12:14:45 PM3/15/16
to TiddlyWiki
You could make something to do this without too much trouble, but I would suggest against adding more special fields to the core.
I haven't looked at the code for the new here button but I am sure you could copy it into a new button that sets the new field while making the tiddler.

Hegart Dmishiv

unread,
Mar 15, 2016, 2:57:39 PM3/15/16
to tiddl...@googlegroups.com
Hi Jed,

Ah, okay, thanks for that. In fact, that might have wider application for something else I'm trying to achieve in the TiddlyCRM project. We've been trying to pre-populate multiple fields using the <$edit-text> widget, and then use the tobibeer/make filter plugin to generate a new tiddler using those fields. If we can just reuse the code from 'New Here', with this extra functionality instead, then that would be ideal. Similar to what I did for re-purposing the core/tabs macro earlier in the {{DesignWrite}} course.

I'll see if I can find the 'New Here' code. Any hints as to where to find it?

Hegart.

Jed Carty

unread,
Mar 16, 2016, 5:05:18 AM3/16/16
to TiddlyWiki
The code is in the tiddler $:/core/ui/Buttons/new-here
It took me a long time to realize that a lot of these things are in shadow tiddlers so you have to search under the shadows tab in advanced search. After I figured that out things are organized pretty well, hopefully that will be helpful for you too.

Ton Gerner

unread,
Mar 16, 2016, 7:39:37 AM3/16/16
to TiddlyWiki
Hi Hegart,

May be this is helpful?

Cheers,

Ton

Hegart Dmishiv

unread,
Mar 16, 2016, 8:55:59 AM3/16/16
to tiddl...@googlegroups.com
Hey, thanks both of you for this,

Using Ton's nifty tool, I took a look at $:/core/ui/Buttons/new-here and it seems to me that the magic happens in this line:

<$action-sendmessage $message="tm-new-tiddler" tags=<<newHereButtonTags>>/>

That still leaves many unanswered questions though. For instance, how do I programmatically set the title of the new tiddler? How do I create the new tiddler silently in the background, without the user ever having to enter edit mode? I think I'll still need to use the tobibeer/make filter plugin to do this. I'm also looking at Mat's QuickTid solution, which looks like it has some promise for us in TiddlyCRM. From what I'm seeing of 'New Here' though, it just doesn't have the firepower I need to get the job done.

It was worth a try though,

Hegart.

Jed Carty

unread,
Mar 16, 2016, 10:57:50 AM3/16/16
to TiddlyWiki
You should be able to set the title using the tm-new-tiddler message but I am not sure if you can make it silent.
Reply all
Reply to author
Forward
0 new messages