Nesting Variables

52 views
Skip to first unread message

Jan

unread,
Feb 15, 2017, 10:01:40 PM2/15/17
to TiddlyWiki
Hi
I want to insert the values some fields of the tiddler currently in
focus into a macro...
Can I use a construction like this to nest variables.

<$set name=foc value={{$:/HistoryList!!current-tiddler}}>
<$vars seminar={{$(foc)$}}!!Seminar}} clipname={{$(foc)$}}!!clip}}
thema={{$(foc)$}}!!thema}}>
<video controls id="fullstart" width=600px poster={{$(foc)$!!poster}}>
<source src=<<cliplink>>>
</video></$vars></$set>

So far it does not work... what do I have to change?

Thanks
Jan

Jed Carty

unread,
Feb 16, 2017, 7:02:50 AM2/16/17
to TiddlyWiki
The $(Variable)$ syntax only works when used inside a macro and the variable was defined outside of the macro. Also there are some extra }} in your code.

Here is one way to make it work:

\define InnerMacro()
<$vars seminar={{$(foc)$!!Seminar}} clipname={{$(foc)$!!clip}}
thema
={{$(foc)$!!thema}}>
<video controls id="fullstart" width=600px poster={{$(foc)$!!poster}}>
<source src=<<cliplink>>>
</video></$vars>

\end


<$set name=foc value={{$:/HistoryList!!current-tiddler}}>
<<InnerMacro>>
</
$set>

but an easier way is probably to use the tiddler widget like this:

<$tiddler tiddler={{$:/HistoryList!!current-tiddler}}>
<$vars seminar={{!!Seminar}} clipname={{!!clip}}
thema={{!!thema}}>
<video controls id="fullstart" width=600px poster={{!!poster}}>
<source src=<
<cliplink>>>
</video></$vars>
</$tiddler>



Jan

unread,
Feb 16, 2017, 8:13:20 AM2/16/17
to tiddl...@googlegroups.com
Hi Jed,
Fantastic!
Thanks for guessing my thoughts, I think I can use this trick a lot.

Jan
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@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/01ccd155-31e1-43c9-a22e-4ee8fa92887a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages