You can't substitute the < > brackets in the middle of a string like that.
You can only substitute them inside a filter expression where a square
bracket would have occurred. But there is a trick to concatenating strings
in filters using the "addprefix" and "addsuffix" operators. So your filter
expression might look like this:
"[[$:/.somewhere/]addsuffix<myvar>]"
But there's a way you can skip "set" and "list" completely:
\define mymacro(index1)
<$tiddler tiddler={{{
[[tiddler1]getindex[$index1$]addprefix[$:/.somewhere/]] }}}>
{{||$:/.somewhere/templates/mytemplate}}
</$tiddler>
\end
Remember to end your macro definitions with \end, BTW.
On Thursday, June 18, 2020 at 8:12:12 PM UTC-7, The Islander wrote:
>
> Hi everyone,
>
> I can't seem to be able to figure out how to get this to work. Appreciate
> your help.
>
>
>
> \define mymacro(index1:"{{!!title}}")
> <$set name="myvar" tiddler="tiddler1" index=$index1$>
> <$list filter="[$:/.somewhere/<myvar>]">{{||$:/.somewhere/templates/
> mytemplate}}</$list>
> </$set>
> \end
>
>
>
>
> Can't seem to figure out what I'm doing wrong.
>
> 1. I need to get a value from a data tiddler (tiddler1) with an index
> equal to the title field of the invoking tiddler (named index1 =
> {{!!title}}).
> 2. The result of first step = myvar.
> 3. I need to take the result and get a tiddler named $:/.somewhere/<myvar>
> 4. I need to display the resulting tiddler using a template named $:
> /.somewhere/templates/mytemplate
>
> The results don't seem to work.
>
> Appreciate your help!
>
> Thanks.
>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/5a5a1b6c-1cb6-457d-81d4-9dad3527162bo%40googlegroups.com.