I am using the core image picker macro to create a custom image picker.
Here I am using a html table within this custom template.
In the bottom part of the table , I am transcluding the custom image picker macro.
In the top part, the image selected using the image picker macro will be shown using field transclusion.
Images are shown in single column or two column depending upon the use of a modifier variable. This use of modifier variable is not working. What is wrong with that part of the code. I have used modifier variable similarly in some other contexts which are working.
\define my-image-picker(actions,filter:"[<currentTiddler>transcludes[]suffix[.png]] +[!has[draft.of]$subfilter$sort[title]]",subfilter:"")
\whitespace trim
<div class="tc-image-chooser">
<$macrocall $name="image-picker-list" filter="""$filter$""" actions=<<__actions__>>/>
</div>
\end
\define image-picker-actions()
<$list filter="[<modifier>match[normal]]" variable=nul>
<$action-setfield $tiddler=<<currentTiddler>> $field="image-1" $value=<<imageTitle>>/>
<$action-deletefield $tiddler=<<currentTiddler>> $field="image-2"/>
</$list>
<$list filter="[<modifier>match[alt]]" variable=nul>
<$action-setfield $tiddler=<<currentTiddler>> $field="image-2" $value=<<imageTitle>>/>
</$list>
\end
<div class="my-img-picker">
<table>
<$list filter="[<currentTiddler>!has[image-2]]" >
<tr>
<td style="width:100%;">
<$transclude $tiddler={{!!image-1}} />
</td>
</tr>
<tr>
<td style="width:100%;">
<$transclude $tiddler={{!!image-1}} $field="label"/>
</td>
</tr>
</$list>
<$list filter="[<currentTiddler>has[image-2]]" >
<tr>
<td style="width:50%;">
<$transclude $tiddler={{!!image-1}} />
</td>
<td style="width:50%;">
<$transclude $tiddler={{!!image-2}} />
</td>
</tr>
<tr>
<td style="width:50%;">
<$transclude $tiddler={{!!image-1}} $field="label"/>
</td>
<td style="width:50%;">
<$transclude $tiddler={{!!image-2}} $field="label"/>
</td>
</tr>
</$list>
<tr>
<td colspan=2>
<$transclude $variable='my-image-picker' actions=<<image-picker-actions>> />
</td>
</tr>
</table>
</div>