{% set handled = false %} {% for block in handle_event('ViewAttachment' ~ attachment.getMimetypeMajor() | capitalize , {'attachment': attachment, 'note': note}) %} {% set handled = true %} {{ block | raw }} {% endfor %} {% if not handled %}
{{ attachment.getBestTitle(note) }}
{% endif %}