{% load thumbnail %} {% with widget.get_size as size %} {% if widget.detail == "open_modal" %} {% if widget.size %} {% thumbnail image.file size format="PNG" as thumb %} {{ image.translation.default_caption|default: {% endthumbnail %} {% else %} {{ image.translation.default_caption|default: {% endif %} {% elif widget.detail == "open_new_window" %} {% if widget.size %} {% thumbnail image.file size format="PNG" as thumb %} {{ image.translation.default_caption|default: {% endthumbnail %} {% else %} {{ image.translation.default_caption|default: {% endif %} {% elif widget.detail == "on_page" %} {% if widget.size %} {% thumbnail image.file size format="PNG" as thumb %} {{ image.translation.default_caption|default: {% endthumbnail %} {% else %} {{ image.translation.default_caption|default: {% endif %} {% else %} {% if widget.size %} {% thumbnail image.file size format="PNG" as thumb %} {{ image.translation.default_caption|default: {% endthumbnail %} {% else %} {{ image.translation.default_caption|default: {% endif %} {% endif %} {% endwith %}