Comments (1)
@anitaeisenhaber sorry for the delay. Thanks for the detailed information.
- You don't need to create a custom Provider. Just override the existing
ImageProvider
of sonata.
It can look like this:
<?php
//App\Application\Sonata\MediaBundle\Provider\ImageProvider.php
namespace App\Application\Sonata\MediaBundle\Provider;
use SilasJoisten\Sonata\MultiUploadBundle\Traits\MultiUploadTrait;
use Sonata\MediaBundle\Provider\ImageProvider as BaseImageProvider;
class ImageProvider extends BaseImageProvider
{
use MultiUploadTrait;
}
Your yaml should look like:
parameters:
sonata.media.provider.image.class: App\Application\Sonata\MediaBundle\Provider\ImageProvider
services:
sonata.media.provider.image:
class: "%sonata.media.provider.image.class%"
arguments:
- "sonata.media.provider.image"
- "@sonata.media.filesystem.local"
- "@sonata.media.cdn.server"
- "@sonata.media.generator.default"
- "@sonata.media.thumbnail.format"
- ['jpg', 'png', 'jpeg', 'gif']
- ['image/pjpeg', 'image/jpeg', 'image/png', 'image/x-png', 'image/gif']
- "@sonata.media.adapter.image.default"
- "@sonata.media.metadata.proxy"
calls:
- [ setTemplates, [ { helper_thumbnail: "Media/Provider/thumbnail.html.twig", helper_view: "Media/Provider/view_image.html.twig"} ] ]
tags:
- { name: sonata.media.provider, multi_upload: true }
public: true
This is almost the same like yours with a few small differences regarding the classname.
This bundle does not provide a form type. It only hooks into the select_provider.html.twig
and links to an multiupload action so you can access the multi upload page via. new
button in list view.
What you could do is generate an url to the multiupload action.
from sonata-multiupload-bundle.
Related Issues (20)
- 4.0.0 version ability to remove provider on runtime over Provider Chain
- Testing `4.0.1-rc` version of this bundle HOT 2
- Rework docs
- Replacing jQuery with VueJS
- Refactoring Translation files
- Return to the media list onComplete HOT 2
- Can't get this bundle to work HOT 1
- Could not upload file in Gallery (Sonata Media Bundle) HOT 6
- Video upload no image shown
- ManagerInterface HOT 1
- Drop PHP 7.0 Support
- Fix TreeBuilder deprecations
- Does not work on Symfony 4 HOT 30
- Cannot autowire service HOT 2
- Argument 1 passed to Sonata\AdminBundle\Controller\CRUDController::get() must be of the type string, null given, called in /var/www/html/Project/vendor/silasjoisten/sonata-multiupload-bundle/src/Controller/MultiUploadController.php on line 55 HOT 13
- Is there any way to define the min/max width-height and orientation requirements? HOT 5
- Update with recent sonata version, drop requirement of "sonata-project/core-bundle" HOT 2
- Add from model type not working anymore HOT 1
- Update Sonata Version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonata-multiupload-bundle.