Hi Steve,
first I think everyone tries to write tw5 like you just did (I still do
occasionally).
The first problem is that attributes to widgets must be either "xx" <<xx>>
or {{xx}}, inside quotes the xx (eg {{tiddlername}})is treated as an
ordinary strings not as wikitext.
next you might try to use a 'join' macro that combines two strings like so:
<$action-sendmessage $message="tm-new-tiddler" title="This is newly created
tiddler" tags=<<join {{$:/status/UserName}} {{$:/tagword}}>> text=<<now
"Today is DDth, MMM YYYY">>/>
Unfortunately tw5 does not allow expansion of transclusions as macro
parameters, so this will not work.
What works well is to use macros to substitute text in wikitext
(substitutions can go anywhere), so this is why I have used the macro
defined as:
\define new(user,newtag)
<$action-sendmessage $message="tm-new-tiddler" title="This is newly created
tiddler" tags=" [[$user$]] [[$newtag$]]" text=<<now "Today is DDth, MMM
YYYY">>/>
\end
You might be tempted to use the macro like:
<<new {{$:/status/UserName}} {{$:/newtag}}>>
However as I said above transclusions as macro parameters do not work,
therefore we have to use the alternative way of using a macro, ie the
macrocall widget, as the widget attributes do not suffer the same
restriction as with the macro syntax.
Hope that makes things clearer.
In my own tiddlywikis I have a plugin to remove the restriction on macro
parameters, as I got fed up with using macro this way!
cheers
BJ
On Saturday, February 18, 2017 at 2:23:23 PM UTC+1, Steven Schneider wrote:
>
> Thanks! Works perfectly. Much appreciated...
>
> Following the ancient TiddlyWiki proverb -- Give a person some code and
> he'll be able to work for the day. Teach a person to code and he'll be able
> to answer the next post in the group" --- it would be great to understand
> (though I'll probably get it eventually, and if it is too time-consuming to
> explain, that's fine):
> Give a man a fish and you feed him for a day; teach a man to fish and you
> feed him for a lifetime.
> Read more at:
> https://www.brainyquote.com/quotes/quotes/m/maimonides326751.htmlGive a
> man a fish and you feed him for a day; teach a man to fish and you feed him
> for a lifetime.
> Read more at:
> https://www.brainyquote.com/quotes/quotes/m/maimonides326751.html
>
> * What's the logic I was missing?
>
> * Where did you come up with the <$macrocall call ...> syntax, and what
> does that do?
>
>
> //steve.
>
>
> On Saturday, February 18, 2017 at 12:56:04 AM UTC-5, BJ wrote:
>>
>> like this:
>>
>> \define new(user,newtag)
>> <$action-sendmessage $message="tm-new-tiddler" title="This is newly
>> created tiddler" tags=" [[$user$]] [[$newtag$]]" text=<<now "Today is
>> DDth, MMM YYYY">>/>
>> \end
>>
>> 1 Make sure there is a username: {{$:/status/UserName}}<br>
>>
>> 2 Select tag:
>> <$select tiddler='$:/newtag'>
>> <option>A Tale of Two Cities</option>
>> <option>A New Kind of Science</option>
>> <option>The Dice Man</option>
>> </$select>
>>
>> 3 Create tiddler with two tags
>>
>> * username: {{$:/status/UserName}}
>> * newtag: {{$:/newtag}}
>>
>> 4 Create new tiddler
>>
>> <$button>
>> <$macrocall call $name="new" user={{$:/status/UserName}} newtag={{$:
>> /newtag}}/>
>> New Tiddler
>> </$button>
>>
>>
>> All the best
>> BJ
>>
>> On Saturday, February 18, 2017 at 5:24:28 AM UTC+1, Steven Schneider
>> wrote:
>>>
>>> Hi folks, I'm interested in creating new tiddlers with multiple tags,
>>> some transcluded and others established by a select widget.
>>>
>>> Here is my code:
>>> 1 Make sure there is a username: {{$:/status/UserName}}<br>
>>>
>>> 2 Select tag:
>>> <$select tiddler='$:/newtag'>
>>> <option>A Tale of Two Cities</option>
>>> <option>A New Kind of Science</option>
>>> <option>The Dice Man</option>
>>> </$select>
>>>
>>> 3 Create tiddler with two tags
>>>
>>> * username: {{$:/status/UserName}}
>>> * newtag: {{$:/newtag}}
>>>
>>> 4 Create new tiddler
>>>
>>> <$button>
>>> <$action-sendmessage $message="tm-new-tiddler" title="This is newly
>>> created tiddler" tags="{{$:/status/UserName}} {{$:/tagword}}"
>>> text=<<now "Today is DDth, MMM YYYY">>/>
>>> New Tiddler
>>> </$button>
>>>
>>>
>>> As you'll see, my tags are interpreted literally:
>>> {{$:/status/UserName}} {{$:/tagword}}
>>>
>>> Rather than as the transcluded values.
>>>
>>> I'd also like to use the username in the title of the tiddler, but have
>>> the same lack-of-transclusion-activity problem.
>>>
>>> I'm a bit stumped. Suggestions?
>>>
>>> Thanks!
>>>
>>> //steve.
>>>
>>>
>>>
--
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/4d460a55-2a45-41d6-a95a-7d0f0fa7b0e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.