{if $contents == ""}
  <div class="cf_field_comments">{$LANG.phrase_not_assigned_to_option_list}</div>
{else}
  {assign var=vals value="`$g_multi_val_delimiter`"|explode:$VALUE}
  <select name="{$NAME}[]" multiple size="{if $num_rows}{$num_rows}{else}5{/if}">
  {foreach from=$contents.options item=curr_group_info name=group}
    {assign var=group_info value=$curr_group_info.group_info}
    {assign var=options value=$curr_group_info.options}
    {if $group_info.group_name}
      <optgroup label="{$group_info.group_name|escape}">
    {/if}
    {foreach from=$options item=option name=row}
      <option value="{$option.option_value}"
        {if $option.option_value|in_array:$vals}selected{/if}>{$option.option_name}</option>
    {/foreach}
    {if $group_info.group_name}
      </optgroup>
    {/if}
  {/foreach}
  </select>
{/if}

{if $comments}
  <div class="cf_field_comments">{$comments}</div>
{/if}