<div class="editor">
  <textarea id="{$NAME}_id" name="{$NAME}">{$VALUE}</textarea>
</div>

<script>
var code_mirror_{$NAME} = new CodeMirror.fromTextArea(document.getElementById("{$NAME}_id"), {literal}{{/literal}
  height: "{$height}px",
  {if $code_markup == "HTML" || $code_markup == "XML"} 
    mode: "xml"
  {elseif $code_markup == "CSS"}
    mode: "css"
  {elseif $code_markup == "JavaScript"}
    mode: "javascript"
  {/if}
  {literal}});{/literal}
</script>

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