Skip to content

Commit

Permalink
Merge pull request #453 from BitBagCommerce/OPSRC-693/media_preview
Browse files Browse the repository at this point in the history
[OPSRC-693]Add preview column in media management list
  • Loading branch information
liszkapawel authored Sep 30, 2022
2 parents a5c389e + 3b7b39e commit ad4b328
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Resources/config/grids/admin/media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/Resources/views/Grid/Field/image_preview.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% if 'image' in data.mimeType %}
<img src="{{ data.path|imagine_filter(filter|default('sylius_admin_product_thumbnail')) }}" class="ui bordered image"/>
{% else %}
<p>{{ data.mimeType }}</p>
{% endif %}

0 comments on commit ad4b328

Please sign in to comment.