Skip to content

Commit e683af1

Browse files
committed
Special preview for SVGs (Not resized)
1 parent 274eb5b commit e683af1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Resources/views/Admin/MediaManager/Modal/Content/Files/_previewFile.html.twig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{% set filePath = folder is not empty ? folder ~ '/' ~ file.path : file.path %}
2-
{% if file.isImage %}
2+
{% if file.isImage and file.mimeType != 'image/svg+xml' %}
33
<a href="/media/{{ filePath }}" target="_blank" rel="noopener noreferrer">
44
<img src="{{ filePath|imagine_filter('monsieurbiz_sylius_media_manager_uploaded_image') }}" alt="{{ filePath|escape('html_attr') }}" style="max-width: 300px;max-height: 30px;" />
55
</a>
6+
{% elseif file.isImage and file.mimeType == 'image/svg+xml' %}
7+
<a href="/media/{{ filePath }}" target="_blank" rel="noopener noreferrer">
8+
<img src="/media/{{ filePath }}" alt="{{ filePath|escape('html_attr') }}" style="max-width: 300px;max-height: 30px;" />
9+
</a>
610
{% elseif file.isFile %}
711
<a href="/media/{{ filePath }}" target="_blank" rel="noopener noreferrer" class="ui button mini icon">
812
<i class="eye icon"></i>

0 commit comments

Comments
 (0)