I want the user of my wiki to be able to enter some text and then make a tiddler with the text as title, and a specific tag by clicking a button of his choice. For instance, for quickly entering a thing-to-do or an idea or a grocery. This works if I hard-code the tags. But if I try to parametrise the procedure used, it does not work. Why not?
Here is my code with only one button:
\procedure make-item(taggy:"DEFAULT")
<%if [{$:/temp/PHB/input}minlength[1]] %>
<$action-createtiddler $basetitle={{$:/temp/PHB/input}} tiddlertype="item" tags=<<taggy>>/>
<$action-deletetiddler $tiddler="$:/temp/PHB/input"/>
<%endif%>
\end
!!Make new item
<$edit-text tiddler="$:/temp/PHB/input" size="70" tag=input />
<$button actions=<<make-item taggy:"TODO">>>Make to-do item</$button>
The new tiddler is created with the entered text for its title, and the ‘tiddlertype’ field is created with the right value. But it gets no tags, not even the default tag ‘DEFAULT’. All goes well if I hard-code the tagging in make-item (i.e. tags="TODO")
What goes wrong? How can I mend it?
Greetings,
Sjaak