How do you substitute a tiddler title into a macro parameter?

66 views
Skip to first unread message

Jeff Vance

unread,
Feb 15, 2017, 2:25:57 PM2/15/17
to TiddlyWiki
I'm having trouble substituting the title of a tiddler into an argument to the tabs macro.  What am I doing wrong?  This is in a macro I'm defining to take the title of the current tiddler, create tabs for all tiddler tagged by this one, then include an additional tiddler that has a "_Summary" suffix.  I want the summary tab selected by default.  It seems that the "default" argument is not working.


\define weeklyView()
<$macrocall $name="tabs"
  tabsList
="[title{!!title}addsuffix[_Summary]][tag{!!title}sort[created]]"
  state
="$:/state/daily_tab"
 
default="{{!!title}}_Summary"
 
class="tc-vertical"
/>
\end




Jed Carty

unread,
Feb 15, 2017, 2:38:32 PM2/15/17
to TiddlyWiki
This is a string concatenation problem. I wrote some stuff about this (http://inmysocks.tiddlyspot.com/#Concatenating%20text%20to%20make%20dynamic%20URLs  and http://inmysocks.tiddlyspot.com/#Concatenating%20Strings%20-%20What%20Breaks)

The quick answer is you do this:

\define weeklyView()
<$macrocall $name="tabs"
  tabsList
="[title{!!title}addsuffix[_Summary]][tag{!!title}sort[created]]"
  state
="$:/state/daily_tab"

 
default="$(currentTiddler)$_Summary"
 
class="tc-vertical"
/>

\end

Jeff Vance

unread,
Feb 15, 2017, 11:52:03 PM2/15/17
to TiddlyWiki
Ah, Perfect!  Thank you!  Works exactly as I wanted.  I'll definitely keep this in mind if I ever need to do something like this again.

Reply all
Reply to author
Forward
0 new messages