简体   繁体   中英

Sonata media - No resizing

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM