Question: cloning and modifying the new-here button

Hi everyone,

I am cloning and modifying the $:/core/ui/Buttons/new-here tiddler.

I would like the new child tiddler created by the button to have a custom field ‘author’, filled with the contents of the author field of the parent tiddler, and a custom ‘sourcetitle’ field, filled with the contents of the sourcetitle field of the parent tiddler.

I think I need to do something close to what I have below:

<$action-sendmessage $message="tm-new-tiddler" ... author=<<author>> sourcetitle=<<sourcetitle>>... />

I tried

<$set name="author" filter="[<currentTiddler>]">

but there are two issues:

  1. It pastes the title of the parent tiddler, not the contents of the author field of the parent tiddler
  2. It wraps it in [[ and ]] if it is more than one word. The contents of those fields are simple text with multiple words, and I want to just paste the text.

What filter would I put? Or is there a better way to do this?

addendum: if you are wondering what I am doing:

  1. The parent tiddler will be for a source (book, webpage, etc).
  2. The child tiddlers will be notes from that source.
  3. The child tiddlers text field: has view widgets that grab the contents of its own author, title and pagenumber fields. That way when I type or paste a note, the author and title will be pre-filled, and I just have to add the page number to the pagenumber custom field.

Hi Dave,

You can try this (not tested):

<$action-sendmessage $message="tm-new-tiddler" ... author={{!!author}} sourcetitle={{!!sourcetitle}}... />

It should work even without the <$set...> widget.

HTH,

Fred

Wow, FRed! you answered before I finished editing my post! All the more impressive is that for me it is 6am. Thanks!!!

2 Likes

2pm here in France :slightly_smiling_face:
That’s what international communities are for! :wink:

Have a nice day,

Fred

4 Likes

@DaveGifford I marked this as “solved” with post by @tw-FRed so folks scanning the overview know it’s all wrapped up… I hope that’s ok with you!