{if $contents == ""}
  <div class="cf_field_comments">
    {$LANG.phrase_not_assigned_to_option_list}
  </div>
{else}
  <select name="{$NAME}">
    {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 array_key_exists("group_name", $group_info) && !empty($group_info["name"])}
      <optgroup label="{$group_info.group_name|escape}">
      {/if}
      {foreach from=$options item=option name=row}
        <option value="{$option.option_value}"
          {if $VALUE == $option.option_value}selected{/if}>{$option.option_name}</option>
      {/foreach}
      {if array_key_exists("group_name", $group_info) && !empty($group_info["name"])}
      </optgroup>
      {/if}
    {/foreach}
  </select>
{/if}
{if $comments}
  <div class="cf_field_comments">{$comments}</div>
{/if}