Calling a macro from a template

I have a template tiddler, that has the following macro definition in it.

It receives a hardware asset type and collects all the data from users and locations that have that hardware type as a field.

\define getHardware(type)
<$list filter="[tag[user]]-[field:$type$[]]">
<$link to={{!!title}}/> {{!!$type$}}
</$list>
<$list filter="[tag[location]]-[field:$type$[]]">
<$link to={{!!title}}/> {{!!$type$}}
</$list>
\end

I want to do one of two things.

  1. I want to bring that macro into another tiddler and run the macro with a parameter. (example below)
    or
  2. I want to call that function directly from my tiddler.
{{||assetTemplate}}

<<getHardware "mouse">>

I don’t know why it doesn’t work. Any help would be appreciated.

I figured it out. I simply used

\import assetTemplate

instead of

{{||assetTemplate}}

Sorry for the bother.

For completness, taging a tiddler containing your macro(s) with $:/tags/Macro makes them global and the more specific tags are often sufficent $:/tags/Macro/View, $:/tags/Macro/View/Body

2 Likes