diff --git a/src/Resources/config/grids/admin/media.yml b/src/Resources/config/grids/admin/media.yml index af8083dad..e5608163f 100644 --- a/src/Resources/config/grids/admin/media.yml +++ b/src/Resources/config/grids/admin/media.yml @@ -12,6 +12,12 @@ sylius_grid: code: asc limits: [10, 25, 50] fields: + media_file: + type: twig + label: bitbag_sylius_cms_plugin.ui.preview + path: . + options: + template: "@BitBagSyliusCmsPlugin/Grid/Field/image_preview.html.twig" name: type: string label: bitbag_sylius_cms_plugin.ui.name diff --git a/src/Resources/views/Grid/Field/image_preview.html.twig b/src/Resources/views/Grid/Field/image_preview.html.twig new file mode 100644 index 000000000..fb85f622a --- /dev/null +++ b/src/Resources/views/Grid/Field/image_preview.html.twig @@ -0,0 +1,5 @@ +{% if 'image' in data.mimeType %} + +{% else %} +
{{ data.mimeType }}
+{% endif %}