{% for d in mydata %}
{{ d.title }}
{% endfor %}
However, I would like the first one to be bolded. How can I use the loop to say...if the d is the first one, then bold it?
{% for d in mydata %}
{{ d.title }}
{% endfor %}
However, I would like the first one to be bolded. How can I use the loop to say...if the d is the first one, then bold it?
Check out http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for. Looks like:
{% for d in mydata %}
{% if forloop.first %}
<strong>{{ d.title }}</strong>
{% else %}
{{ d.title }}
{% endif %}
{% endfor %}