On Monday, April 24, 2017 at 8:09:08 PM UTC+3, Eric Shulman wrote: > > On Monday, April 24, 2017 at 9:42:20 AM UTC-7, Vayu Asura wrote: >> >> I have this defined >> \define failed(tiddler:<<CurrentTiddler>> value:"Failed") >> <$radio tiddler=$tiddler$ field="Status" value=$value$> $value$ </$radio> >> \end >> when I try to call >> |[[System Usage]]|<<failed tiddler: "System Usage">>|<<passed tiddler: >> "System >> Usage" >>| >> to modify "System Usage" tiddler it modifies "System" tiddler instead. >> > > Macro parameters work by substitution. When the macro is invoked, all > parameter references within the macro (e.g., $variablename$) are > automatically replaced by their passed in values. Thus, when you invoke > <<failed tiddler:"System Usage">> > this line of the macro > <$radio tiddler=$tiddler$ field="Status" value=$value$> $value$ </$radio> > results in the following syntax > <$radio tiddler=System Usage field="Status" value=failed> $value$ </$radio> > > The problem is that there aren't any quotes around the 'tiddler' param in > the <$radio> widget, so the space in the value appears to be a delimeter, > making "Usage" into a separate param which lacks the "name=" syntax, and is > thus ignored. The result is as you noted: the tiddler title being applied > ends with the first space, and the remainder of the title is ignored. > > To correct this, simply add some quotes surrounding the params in the > <$radio> widget, like this: > <$radio tiddler="$tiddler$" field="Status" value="$value$"> $value$ > </$radio> > which results in the following syntax being generated by the macro: > <$radio tiddler="System Usage" field="Status" value="failed"> failed > </$radio> > > That should do it. Let me know how it goes. > > enjoy, > -e > Eric Shulman > TiddlyTools.com - "Small Tools for Big Ideas!" (tm) > InsideTiddlyWiki: The Missing Manuals >
Thanks. That was the issue. However that caused another issue - default to <<CurrentTiddler>> stopped working as it parses variable as plain text thus modifying tiddler called '<<Current Tiddler>>' by default. -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/a180fb2f-0b65-472a-9fb4-43d15903aa51%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.