monsieurbiz / sylius-media-manager-plugin
Add a media manager to your Sylius.
Installs: 50 522
Dependents: 5
Suggesters: 1
Security: 0
Stars: 16
Watchers: 2
Forks: 10
Open Issues: 1
Type:sylius-plugin
pkg:composer/monsieurbiz/sylius-media-manager-plugin
Requires
- php: ^8.1
- sylius/sylius: ~2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.16
- phpmd/phpmd: ^2.15
- phpspec/phpspec: ^7.0
- phpstan/phpstan: ^1.8.4
- phpstan/phpstan-doctrine: ^1.3.2
- phpstan/phpstan-webmozart-assert: ^1.1
- phpunit/phpunit: ^10.5
- 3.x-dev
- v3.0.1
- v3.0.0
- 2.x-dev
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.x-dev
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- dev-master / 1.1.x-dev
- v1.1.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-RC.4
- v1.0.0-RC.3
- v1.0.0-RC.2
- v1.0.0-RC.1
- dev-revert-37-3.x
- dev-feature/rich-editor-compatibility
This package is auto-updated.
Last update: 2025-12-03 08:10:17 UTC
README
Sylius Media Manager
This plugin adds a media manager to your images, videos and other files type fields in Sylius.
Compatibility
| Sylius Version | PHP Version |
|---|---|
| 2.0, 2.1 | 8.2 - 8.3 |
âšī¸ For Sylius 1.x, see our 1.x branch and all 1.x releases.
Installation
If you want to use our recipes, you can configure your composer.json by running:
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
Install the plugin via composer:
composer require monsieurbiz/sylius-media-manager-plugin
Change your config/bundles.php file to add this line for the plugin declaration:
<?php return [ //.. MonsieurBiz\SyliusMediaManagerPlugin\MonsieurBizSyliusMediaManagerPlugin::class => ['all' => true], ];
Copy the plugin configuration files in your config folder: https://github.com/monsieurbiz/symfony-recipes/tree/master/monsieurbiz/sylius-media-manager-plugin/3.0/config
Add these variables to your .env :
MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_PUBLIC_FOLDER=%kernel.project_dir%/public
MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_ROOT_FOLDER_FROM_PUBLIC=media
MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_MAX_FILE_SIZE=5M
Copy the templates in the folder dist/templates/ to ensure that form fields are rendered correctly:
cp -R vendor/monsieurbiz/sylius-media-manager-plugin/dist/templates/bundles/* templates/bundles/
Copy the form extension if you want to use it on your product images.
cp -R vendor/monsieurbiz/sylius-media-manager-plugin/dist/src/Form/Extension/ProductImageTypeExtension.php src/Form/Extension/ProductImageTypeExtension.php
Else remove the file templates/bundles/SyliusAdminBundle/product/form/sections/media/images.html.twig
Use form types
You can check the dist folder to check how the plugin is setup on the test application.
Images
Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\ImageType
Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\PdfType
Video
Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\VideoType
Favicon
Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\FaviconType
Audio
Use MonsieurBiz\SyliusMediaManagerPlugin\Form\Type\AudioType
Configuration
You can specify the default maximum file size allowed for the media manager by setting the MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_MAX_FILE_SIZE environment variable.
Is it possible to define a maximum file size for each form type by define the MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_MAX_FILE_SIZE_{TYPE} environment variable.
Example: MONSIEURBIZ_SYLIUS_MEDIA_MANAGER_MAX_FILE_SIZE_IMAGE=1M will set the maximum file size for the image type to 1M.
Contributing
You can find a way to run the plugin without effort in the file DEVELOPMENT.md.
Then you can open an issue or a Pull Request if you want! đ
Thank you!
License
This plugin is completely free and released under the MIT License.

