I am trying to set one tag to tiddler title of the tiddler containing
the button with the macro,
and the other tag to a static value: KOFF
<<newTiddlerWithForm formTemplateName buttonLabel [titleExpression
[askUser]] >>
This is the documentation on how to pass parameters. There is no tag
parameter. Toward the end of the code in the FormTiddlerPlugin the
code for the newTiddlerWithForm macro can be found.
I tried adding a tag parameter when using the macro button passing
{{tiddler.title}} to the macro and changing the macro trying to set
the tag, but the new tiddler opens with an error from the macro tags
"undefined". The static KOFF-tag gets set alright.
What am I doing wrong?
I use the macro like this:
<<newTiddlerWithForm KOFFtemplate buttonlabel {{tiddler.title}}
dontaskUser {{"[[" + tiddler.title + "]]"}} >>
I added var parentTiddlerTag to hold the tag:
// get the (optional) tiddlerName script and "askUser"
var tiddlerNameScript;
var askUser = false;
var parentTiddlerTag;
if (i < params.length) {
tiddlerNameScript = params[i];
i++;
if (i < params.length && params[i] == "askUser") {
askUser = true;
i++;
if (i < params.length) {
parentTiddlerTag = params[i];
i++;
}
}
}
I put the tag KOFF and the variable parentTiddlerTag in the tags
array:
if (tiddlerName) {
var body = "<<formTiddler
[["+formTemplateName+"]]>>";
var tags = ["KOFF", parentTiddlerTag];
store.saveTiddler
(tiddlerName,tiddlerName,body,config.options.txtUserName,new Date
(),tags);
story.displayTiddler(null,tiddlerName,1);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---