Multiple values in one variable (within a macro call)

60 views
Skip to first unread message

jonath...@wolke7.net

unread,
Jul 27, 2016, 6:28:42 AM7/27/16
to tiddl...@googlegroups.com

 

Hi there again,

 

I would like to call a macro with a set of tiddler titles (similar to an „array“ variable)

 

<<myMacro Tiddler1,Tiddler2,Tiddler3 >>

 

And the macro has to output a list of links to these tiddlers.

 

\myMacro(ttl)

<$list filter="[[$ttl$]]" />

\end

 

How would I do this?

 

Thanks in advance!

 

 

 

 

 

PMario

unread,
Jul 27, 2016, 7:49:05 AM7/27/16
to TiddlyWiki, jonath...@wolke7.net
Try this:

\define test(asdf:"hello!" ttl )
$asdf$

<$list filter="""$ttl$""" ><$link to=<<currentTiddler>> tooltip=<<currentTiddler>> ><<currentTiddler>><br></$link></$list>


<ul>
<$list filter="""$ttl$""" ><li><$view field=title></li></$list>
</ul>
\end

<<test ttl:"""HelloThere [[Customize TiddlyWiki]] [[Working with TiddlyWiki]] """>>


macros can use named parameters. See my <<test ttl:xxx>> call. In normal cases we use single "double quotes" to cover the parameter array. ... but if a tiddler title contains a single double quote eg: [[test "asdf"]] the TW parser is confused.

<<test ttl:"[[test "asdf"]]">>  .. won't work but  <<test ttl:"""[[test "asdf"]]""">> works.


hope that helps!

also see: http://tiddlywiki.com/#Macros%20in%20WikiText:%5B%5BMacros%20in%20WikiText%5D%5D%20%5B%5BMacro%20Calls%20in%20WikiText%5D%5D%20%5B%5BMacro%20Calls%20in%20WikiText%20(Examples)%5D%5D%20%5B%5BMacro%20Definitions%20in%20WikiText%5D%5D%20Macros

have fun!
mario

Reply all
Reply to author
Forward
0 new messages