Showing a generic image when no image is chosen I'm trying to do this:

{% for image in entry.illustration %}
    {% if image | length %}
        &lt;a href="{{ entry.url }}" class="flag__img"&gt;
            &lt;img src="{{ image.getUrl }}" alt="{{ entry.altText }}" class="profile__image"&gt;
        &lt;/a&gt;
    {% else %}  
        &lt;p&gt;No image.&lt;/p&gt;        
    {% endif %}
{% endfor %}


Without any luck. What would be a good way of telling craft to do something else if entry.illustration does not have an image defined?
You may want to try this:

{% for image in entry.illustration %}
  {% if image %}
      &lt;a href="{{ entry.url }}" class="flag__img"&gt;&lt;img src="{{ image.getUrl() }}" alt="{{ entry.altText }}" class="profile__image" /&gt;&lt;/a&gt;
  {% else %}
    &lt;p&gt;No image.&lt;/p&gt;
  {% endif %}
{% endfor %}  


(Assuming the altText field is an entry field.) :)