What can be the mistake if a macro does not show in a different layout?

I have a macro calle pic to show pictures which works well in the normal default layout.

\define pic(source, caption)
<$button class="tc-btn-invisible" style="text-align:center; width:100%">
<center><img style='height: 100%; width: 100%; max-height:90vh; object-fit: contain' src="$source$"/></center>
<$list filter="[[$:/state/stage]!text[slideshow]]">
<$action-setfield $tiddler="$:/temp/ImageMagnifier" text="-60"/>
<$action-sendmessage $message="tm-modal" $param="$:/plugins/JJ/ImageViewer" source="$source$" caption="$caption$"/>
</$list>
<$action-sendmessage $message="tm-full-screen" $param="enter" />
</$button>
<div style="margin-top:0px; text-align:center"> $caption$ </div>
\end

Now I switched to using the new Layout-concept using this Layout to show tiddlers as a grid of small cards:

<div class="gridpage">
<div class="gridarchive">
<$list filter="[[$:/config/Plugins/Gridlist]has[gridtag]get[gridtag]is[tag]]" emptyMessage=<<nofill>> >
<$list filter="[[$:/config/Plugins/Gridlist]get[griddisplay]]">
<$wikify name="aFormat" text=<<articleFormat>> >
<$button class=<<aFormat>> actions=<<SetStory>> >
<$button class="removefilter" id="scrollanchor" style="background-color:red">
<div class="rotremove">remove filter</div>
<$action-setfield $tiddler="$:/config/Plugins/Gridlist" gridtag=""/>
</$button>
<$list filter="[all[current]!search:articleformat[caption]]" emptyMessage=<<fText>>>
<h1 style="font-size:2em">{{!!title}}</h1>
</$list>
</$button>
</$wikify></$list></$list>
<$list filter={{$:/config/Plugins/Gridlist}} >
<$wikify name="aFormat" text=<<articleFormat>> >    
<$button class=<<aFormat>> actions=<<gridAction>>>
<$wikify name="hFormat" text=<<headerFormat>> >
<h1 class="a-header" style=<<hFormat>>><<GridAlias>></h1>
</$wikify>
<<fText>>
<$action-scrolltotop/>
    </$button>
</$wikify>
</$list>
<$button class="article" id="scrollanchor" style="fill:red">
<$action-navigate $to="$:/Plugins/JJ/Grid/ControlPanel"/>
<$action-deletetiddler $tiddler="$:/layout"/>
<center>
<h1>{{$:/core/images/options-button}}</h1>
<h1>exit and control</h1>
</center>
<$action-setfield $tiddler="$:/config/Plugins/Gridlist" gridtag=""/>
</$button>
  </div>
</div>

Suddenly I do not see the pictures rendered by the macro anymore. What is wrong?

Global macros are not available in a new layout unless you import them. You can copy the import pragma line from the default page template.

3 Likes