How to create a custom image widget

\widget $image(tid,source,label)
<$parameters tid="" source={{!!_canonical_uri}} label={{!!label}}>
<$genesis
  $type="$image"
  $remappable="no"
  >
<$slot $name="ts-raw">
</$slot>
</$genesis>
<$tiddler tiddler=<<tid>> >
  <table>
    <tr>
      <td>
        <img src=<<source>> />
      </td>
      <td>
        <$transclude field=<<label>> />
      </td>
    </tr>
  </table>
  </$tiddler>
</$parameters>
\end


this custom widget should use a html table with image displayed in one column using _canonical_uri field and the label field of the image tiddler is transcluded in the second column. I am not getting the desired result with this code. Can someone give some suggestions?

maybe this is what you want:

\widget $image(source)
<$parameters $params="all">
<table><tr><td>
    <$genesis   $type="$image"  $remappable="no" 	$names="[<all>jsonindexes[]]" 
                $values="[<all>jsonindexes[]] :map[<all>jsonget<currentTiddler>]"/>
</td><td>
    <$text text=`${[<source>get[label]]}$`/>
</td></tr></table>
</$parameters>
\end
1 Like

Thank you @buggyj . This will help me getting started. I want to add more features to image widget which are suited for my workflow. I need to experiment a little more.