<% if(templateId == 4 || templateId == 5 || templateId == 6 || templateId == 7 || templateId == 8 || templateId == 9) { %>
<% if(caption.length > 20) {%>
<%= caption %>
<% } else { %>
<%= caption %>
<% } %>
<% } else { %>
<% if(caption.length > 20) {%>
<%= caption %>
<% } else { %>
<%= caption %>
<% } %>
<% } %>