Display thumbnail using defineTableAttributes for a custom Element Type Hi,

I'm new to Craft and VERY new to plugin development.  I'd like to display a thumbnail image in my table list view and thought it would be possible to accomplish using a new Custom Element Type.  Does anybody know how to achieve this?

I have managed to output custom fields in the table using defineTableAttributes() but I can't output any related Assets - in particular their filenames. Do I need to define a relation in the ElementCriteriaModel using the defineCriteriaAttributes() function?  Can anyone explain how this is done?

Many thanks
Ok, so I've managed to get an answer to this courtesy of Brandon Kelly.  It's much more simple than I thought.  Firstly, you do not have to specify a relatedTo parameter the defineCriteriaAttributes(). Craft takes care of this automatically.  So in order to retrieve the details of an asset in a table list view you do the following in the getTableAttributeHtml() function in your custom Element Type class:

$relatedAsset = $element-&gt;myAssetsField-&gt;first();


This simple line of code gets a related myAssetsField of your element. I'm not sure why, but this object is placed in an array...  Maybe someone can tell me why this is the case?

I then took the fist element of the array and used a the getThumbUrl() function which is really handy for quickly outputting the url to a thumbnail.  I passed a size of 60 pixels.

case 'myAttribute&gt;':
{   
   if(count($relatedAsset) &gt; 0) {
      return '&lt;img src="'.$relatedAsset[0]-&gt;getThumbUrl(60).'"&gt;';
   }
   return '';
}


The result is a thumbnail in your table list!
Hope this helps others....