Jul 31st, 2011, 9:37 AM
Hi Lina,
Great questions!
So for the first one, how about just moving the foreach block into the appropriate spot (within the <td></td>)? If it's outputting it properly, would that work? Try this:
But I'm kind of surprised that this works...
I've have thought that in the context, you'd need to use:
But whatever works!
For the second question - yes, pulling them out of sessions would have been my first guess, too. However I just looked over the code and the sessions aren't being passed to the template, so I'm afraid you can't.
But this is very reasonable indeed. I'm going to jot it down as a feature request so I can include it in a new version. Stashing the client information in separate database fields would certainly work, but it would be such a shame - and a terrible hack...!
Sorry I couldn't be more help on that. Let me know how the first issue goes.
- Ben
Great questions!
So for the first one, how about just moving the foreach block into the appropriate spot (within the <td></td>)? If it's outputting it properly, would that work? Try this:
Code:
{* loop through all submissions in the current result set *}
{foreach from=$submissions item=submission name=row}
<table cellpadding="2" cellspacing="0" width="610" class="print_table2">
<tr>
<td width="243" valign="top">Last name (additional text here)</td>
<td width="347" class="big">{$submission.last_name}</td>
</tr>
<tr>
<td valign="top">Name (additional text here)</td>
<td class="big">{$submission.name}</td>
</tr>
<tr>
<td valign="top">Country (additional text here)</td>
<td class="big">
{foreach from=$display_fields item=field name=col_row}
{assign var=field_id value=$field.field_id}
{assign var=field_type value=$field.field_info.field_type}
{assign var=col_name value=$field.col_name}
{assign var=value value=$submission.$col_name}
{if $col_name == "country"}
{smart_display_field_values field_id=$field_id selected=$submission.country}
{/if}
{/foreach}
</td>
</tr>
<tr>
<td valign="top">Client number (additional text here)</td>
<td class="big">{$submission.client_number}</td>
</tr>
</table>
{if !$smarty.foreach.row.last}
<br />
<div class="no_print"><i>- {$LANG.phrase_new_page} -</i></div>
<br class="page_break" />
{/if}
{/foreach}
But I'm kind of surprised that this works...
Code:
{smart_display_field_values field_id=$field_id selected=$submission.country}
I've have thought that in the context, you'd need to use:
Code:
{smart_display_field_values field_id=$field_id selected=$value}
But whatever works!
For the second question - yes, pulling them out of sessions would have been my first guess, too. However I just looked over the code and the sessions aren't being passed to the template, so I'm afraid you can't.

But this is very reasonable indeed. I'm going to jot it down as a feature request so I can include it in a new version. Stashing the client information in separate database fields would certainly work, but it would be such a shame - and a terrible hack...!
Sorry I couldn't be more help on that. Let me know how the first issue goes.
- Ben