{% for item in legend %} {% if item.type == "icon" %} {% elseif item.type == "text" %} {{ item.caption }}: {% endif %} {{ item.description }} {% endfor %}