0

I would like to know if that's possible to get an image with {% path %} or {% media %} in a twig template from sonata, without crop/resize ? It seems that it's required to specify a format, but I would like to keep the original size in some case.

I have the idea to make a resizer that does nothing for this problem, but is it possible to specify a resizer by context and not a resizer for a provider in all contexts please ? Because I need to use a resizer in some case, but not in all.

Peekmo
  • 2,843
  • 2
  • 19
  • 25

1 Answers1

2

If you want to display your uploaded image without resize / crop in twig you can do :

{% media media, 'reference' %}

More details in the documentation on how to use the twig helpers.

HypeR
  • 2,186
  • 16
  • 22
  • I'll try thank you, not really explicit in documentation... "Render the path to a sonata.media.provider.file context" – Peekmo Mar 20 '15 at 14:05