{% load displaypage_tags %} {# Media-browser picker writing a Media id into its hidden field (section-editor.js). Context: field, type (image / video / audio / pdf, or "" for any file), label; optional hint, show_if, crop_from (the picker field to crop this image from: adds a "Crop from main image" button) and crop_aspect (width / height of the crop, default 1 / 1.618). #} {% dp_field_media field as media %} {% if crop_from %}{% dp_field_media crop_from as crop_source %}{% endif %}
{{ field }}
{% if media %} {% if media.media_type == 'image' %}{% endif %} {{ media|dp_media_label }}{% if media|dp_file_ext %} ({{ media|dp_file_ext }}){% endif %} {% else %} None chosen {% endif %}
{% if crop_from %}{% endif %}
{% if field.errors %}{% endif %}