Whenever you're thinking of concatenating transclusions from fields or
tiddlers, you're probably going to need a macro. Technically all that TW5
macros actually do is concatenate/substitute text. There are different ways
of doing this. Sometimes you might set a local variable. In this case I
moved all your code into a macrocall and then call it with the MacroCall
widget, which can accept and pass the field values you want to the macro.
Note, you can't use "text" as a field in this context, because the "text"
field is already used as the name for the contents of the current tiddler.
This causes a self-referential loop and crashes the TW and, in my case, the
entire browser. Besides, you want to use the text to form a single-line
title. I created a "text2" field in which to put the text in the example
below. You could, if you wanted, refer to the text field of a different
tiddler.
HTH
Mark
\define myway(par1 par2)
<$button>
<$action-sendmessage $message="tm-new-tiddler"
title="$par1$ - $par2$"
/>
New Tiddler
</$button>
\end
<$macrocall $name="myway" par1={{!!date}} par2={{!!text2}}/>
On Monday, May 8, 2017 at 5:40:40 AM UTC-7, Gordan Nia wrote:
>
> It should be trivial, but I can't find a solution:
>
> ... to concatenate two or more fields to use them in title of new tiddler
> created by button, e.g:
>
>
> <$button>
> <$action-sendmessage $message="tm-new-tiddler"
>
> title="{{!!date}} - {{!!text}}"
>
> />
> New Tiddler
> </$button>
>
>
>
> How?
>
> Thnx!
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/48604c82-ad1a-4a69-9314-5242b25e1ca8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.