Closed jrdnrc closed 10 years ago
You can specify a context at upload time. This is explained in the documentation: https://github.com/coopTilleuls/CoopTilleulsCKEditorSonataMediaBundle/blob/master/Resources/doc/architecture.md
More about contexts: http://sonata-project.org/bundles/media/master/doc/reference/media_context.html
Yeah, I'm aware you can specify a context. I also want to specify a format for the image to use by default though, eg small/medium/large/whatever else I have defined.
Cheers
Sent from my iPhone
On 12 Nov 2013, at 19:25, Kévin Dunglas notifications@github.com wrote:
You can specify a context. This is explained in the documentation: https://github.com/coopTilleuls/CoopTilleulsCKEditorSonataMediaBundle/blob/master/Resources/doc/architecture.md
More about contexts: http://sonata-project.org/bundles/media/master/doc/reference/media_context.html
— Reply to this email directly or view it on GitHub.
You can add a persistent parameter, then filter the formats array in browserAction (https://github.com/coopTilleuls/CoopTilleulsCKEditorSonataMediaBundle/blob/master/Controller/MediaAdminController.php#L58L61) and change the links to the media reference URL by your configured default format in the template browser.html.twig. It's an idea but maybe not the cleanest.
From what I know, there is no way to specify a default format for a context in SonataMediaBundle
. But you can override SonataMediaBundle
to add this feature in your application to fit your needs.
Hi,
Is it possible to use a specified format automatically when uploading images? For example, I upload high res images, which aren't suitable for displaying inline in a web page, and Sonata Media Bundle resizes them to small, medium, and large. Is it possible to have it use the medium size as soon as the image is uploaded?
Cheers