<ul> {% for post in posts %} {% if post.title %} <li>{{ post.title | raw }}</li> {% else %} <li>Post</li> {% endif %} {% endfor %} </ul>