Sep 27th, 2011, 3:50 PM
Hi Valch,
Sorry for the wait!
To output an image as an actual image instead of just the URL/filename, you'll need something like this. I made it as simple as possible. This is based on the "table format" HTML/Printer-friendly Export Type.
The important bit is this:
That looks at the current field name. If it's "field2" (which here, contains the image field - you will need to change that to whatever field name your image field(s) have).
You'll also need to update the URL to the file as well.
Hope this helps -
Ben
Sorry for the wait!
To output an image as an actual image instead of just the URL/filename, you'll need something like this. I made it as simple as possible. This is based on the "table format" HTML/Printer-friendly Export Type.
Code:
<h1>{$form_name} - {$view_name}</h1>
<table cellpadding="2" cellspacing="0" width="100%" class="print_table">
<tr>
{foreach from=$display_fields item=column}
<th>{$column.field_title}</th>
{/foreach}
</tr>
{strip}
{foreach from=$submissions item=submission}
{assign var=submission_id value=$submission.submission_id}
<tr>
{foreach from=$display_fields item=field_info}
{assign var=col_name value=$field_info.col_name}
{assign var=value value=$submission.$col_name}
<td>
{if $field_info.field_name == "field2"}
<img src="http://www.yoursite.com/folder/{$value}" />
{else}
{smart_display_field form_id=$form_id view_id=$view_id
submission_id=$submission_id field_info=$field_info
field_types=$field_types settings=$settings value=$value}
{/if}
</td>
{/foreach}
</tr>
{/foreach}
{/strip}
</table>
The important bit is this:
Code:
{if $field_info.field_name == "field2"}
<img src="http://www.yoursite.com/folder/{$value}" />
{else}
{smart_display_field form_id=$form_id view_id=$view_id
submission_id=$submission_id field_info=$field_info
field_types=$field_types settings=$settings value=$value}
{/if}
That looks at the current field name. If it's "field2" (which here, contains the image field - you will need to change that to whatever field name your image field(s) have).
You'll also need to update the URL to the file as well.
Hope this helps -
Ben