On Tuesday, March 3, 2020 at 3:19:01 AM UTC-8, vpl wrote:
>
> In the code below the user gives a name for a play list (PL_name) and once 
> it clicks on the button I would like to create a new tiddler "My new 
> tiddler" with 2 tags
> One is hard coded ("first-tag") the other is set to the value entered by 
> the user
>

In your code, you are using $action-setfield to set the tags to a literal 
text string:
<$action-setfield $tiddler="My new tiddler" tags="first-tag 
{{playListTemplate!!PL_name}}"/>
However, TiddlyWiki syntax doesn't evaluate this literal string to expand 
references within it.  Thus, the resulting tags are exactly what is in 
between the quotes.

Fortunately, there is a different widget, $action-listops, that uses a 
"$filter" parameter that IS evaluated and produces a space-separated list 
which is then assigned to the specified field.

The following will create a "tags" field that has the two tags you want.
<$action-listops $tiddler="My new tiddler" $field="tags" $filter="first-tag 
[{playListTemplate!!PL_name}]"/>

Note the use of *single* square brackets and curly braces in the filter.  
The square brackets define a "filter run", and the curly braces retrieve 
the desired field value.

enjoy,
-e

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/62782607-759d-43f9-a0e4-fc5225920b55%40googlegroups.com.

Reply via email to