First: you can do this without $wikify by changing the <<added>>
procedure to a function:
\function added() ADDED [<now DD-MM-YYYY>] +[join[ ]format:titlelist[]]
\procedure actions() <$action-createtiddler $basetitle="Book Title" tags=<<added>> />
<$button actions=<<actions>>>Create new book record</$button>
Switching to a function also makes it more convenient to add +[join[ ]format:titlelist[]]
, which is the key step you were missing. Breaking it down:
- The
$action-createtiddler
treats all attributes that don’t begin with $
as the names of fields, and assigns whatever value you give the attribute as the new value of that field. Thus, your original code would create a new tiddler with tags: ADDED 19-2-2025
. Note the lack of square brackets!
- Although the
tags
field gets special handling in edit mode, behind the scenes, it’s just a field in title-list format — that is, a list of space-separated values where multi-word values must be [[surrounded in square brackets]].
- This is more obvious if you look at the Fields tab of the tiddler info, usually available under the “more” dropdown in your tiddler toolbar; this will show you all the fields in use on a tiddler, including the special system fields you don’t normally see.
-
tags: ADDED 19-2-2025
will thus be parsed as two tags, “Added” and “19-2-2025”, rather than the single tag you want.
- To get a single tag, you need to…
-
join
both elements with a space, and
-
format:titlelist[]
to add the necessary square brackets.
If you do want to keep your $wikify approach, here’s how I’d change it:
\procedure added()
ADDED <<now DD-MM-YYYY>>
\end
\procedure actions()
<$wikify name="tx" text=<<added>>>
<$action-createtiddler $basetitle="Book Title" tags={{{ [<tx>join[ ]format:titlelist[]] }}} />
</$wikify>
\end