black / sylius-banner-plugin
Show Banner/slider/carousel in your shop
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 6
Open Issues: 0
Type:sylius-plugin
Requires
- php: ^7.4 || ^8.0
- sylius/sylius: ~1.9.0 || ~1.10.0
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- friendsofsymfony/oauth-server-bundle: ^1.6 || >2.0.0-alpha.0 ^2.0@dev
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: 0.12.85
- phpstan/phpstan-doctrine: 0.12.33
- phpstan/phpstan-strict-rules: ^0.12.0
- phpstan/phpstan-webmozart-assert: 0.12.12
- phpunit/phpunit: ^9.5
- sensiolabs/security-checker: ^6.0
- sylius-labs/coding-standard: ^4.0
- symfony/browser-kit: ^4.4 || ^5.2
- symfony/debug-bundle: ^4.4 || ^5.2
- symfony/dotenv: ^4.4 || ^5.2
- symfony/intl: ^4.4 || ^5.2
- symfony/web-profiler-bundle: ^4.4 || ^5.2
- symfony/webpack-encore-bundle: ^1.12
- vimeo/psalm: 4.7.1
This package is auto-updated.
Last update: 2024-11-09 16:11:49 UTC
README
Banner Plugin
Add banner/carousel to your shop
Warning
The following instructions are compatible with Bootstrap and Webpack Encore. This plugin is in beta.
Installation
- Install Sylius
- Import the configuration
# config/packages/sylius_banner.yaml imports: - { resource: "@BlackSyliusBannerPlugin/config/app/config.php" }
- Import routing
# config/routes/sylius_banner.yaml black_sylius_banner_shop: resource: "@BlackSyliusBannerPlugin/config/routes/shop.yaml" black_sylius_banner_admin: resource: "@BlackSyliusBannerPlugin/config/routes/admin.yaml" prefix: '/%sylius_admin.path_name%'
- Register the bundle:
<?php // config/bundles.php return [ // ... Black\SyliusBannerPlugin\BlackSyliusBannerPlugin::class => ['all' => true], ];
- Add the bundle and dependencies in your
composer.json
composer require black/sylius-banner-plugin:^1.0.0@dev
- Execute migration
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate
- Render the template
# In the desired twig file {{ render(url('black_sylius_banner_shop_banner_partial', { 'code': 'banner1', 'template': '@BlackSyliusBannerPlugin/_banner.html.twig' // optional (default template) })) }}
Tip: Replace the content of Homepage/_banner.html.twig
with this snippet and use template
events!
Quickstart Installation (docker)
-
Run
composer create-project pocky/modern-plugin-skeleton ProjectName
or clone this project -
From the plugin skeleton root directory, run the following commands:
$ sudo chmod -Rf 777 tests/Application/var $ docker-compose exec php php -d memory_limit=-1 /usr/bin/composer install $ docker-compose exec nodejs yarn --cwd tests/Application install $ docker-compose exec php tests/Application/bin/console doctrine:database:create --if-not-exists -vvv $ docker-compose exec php tests/Application/bin/console doctrine:schema:create -vvv $ docker-compose exec php tests/Application/bin/console assets:install tests/Application/public -vvv $ docker-compose exec nodejs yarn --cwd tests/Application build $ docker-compose exec php tests/Application/bin/console cache:warmup -vvv $ docker-compose exec php tests/Application/bin/console sylius:fixtures:load -n
Quality tools
$ docker-compose exec php composer validate --ansi --strict $ docker-compose exec php vendor/bin/phpstan analyse -c phpstan.neon -l max src/ $ docker-compose exec php vendor/bin/psalm $ docker-compose exec php vendor/bin/phpspec run --ansi -f progress --no-interaction $ docker-compose exec php vendor/bin/phpunit --colors=always $ docker-compose exec php vendor/bin/behat --profile docker --colors --strict -vvv --no-interaction
ProTip use Makefile
;)
Override
This plugin use the default bootstrap carousel. You don't need any configuration.
If you want to use another carousel, feel free to override.
Complete configuration
parameters: black_banner.uploader.filesystem: "black_sylius_banner" doctrine: orm: auto_generate_proxy_classes: "%kernel.debug%" entity_managers: default: auto_mapping: true knp_gaufrette: adapters: black_sylius_banner: safe_local: directory: "%sylius_core.public_dir%/media/banner/" create: true filesystems: black_sylius_banner: adapter: "%black_banner.uploader.filesystem%" stream_wrapper: ~ liip_imagine: loaders: black_sylius_banner: stream: wrapper: gaufrette://black_sylius_banner/ filter_sets: black_sylius_banner: data_loader: black_sylius_banner filters: upscale: { min: [1200, 400] } thumbnail: { size: [1200, 400], mode: inbound } sylius_grid: templates: filter: banner_channel: '@BlackSyliusBannerPlugin/Admin/Grid/Filter/channel.html.twig' grids: black_sylius_banner: driver: name: doctrine/orm options: class: 'expr:parameter("black_sylius_banner.model.banner.class")' fields: code: type: string label: sylius.ui.code name: type: string label: sylius.ui.name filters: code: label: sylius.ui.code type: string name: label: sylius.ui.name type: string channel: type: banner_channel label: sylius.ui.channel actions: main: create: type: create item: update: type: update delete: type: delete
License and Copyright
tl;dr:
- Modifications must be shared,
- It's possible to use this plugin in a commercial project,
- A commercial license is available.
This project is licensed under EUPL-1.2. This license implies that if you modify this plugin, you must share those modifications (like AGPL). However, the EUPL-1.2 license applies only on this plugin and this is not viral (like LGPL).
If you don't want to follow this or do not want to use EUPL-1.2 licensed software, you must buy commercial license. Contact us for more information.
Credits
Created by Alexandre Balmes. Some files related to slide upload are 99% from Sylius Core. We will see if it was a realy good idea to not use the default ImageInterface ;)
Sponsors
This project was made possible thanks to the support of: