odiseoteam/sylius-banner-plugin

This plugin add banners to your Sylius project


README

Description

This plugin add banners to the Sylius content. The banners are fully customizable by the admin.

Banners admin

Demo

You can see this plugin in action in our Sylius Demo application.

Installation

  1. Run composer require odiseoteam/sylius-banner-plugin.

  2. Add the plugin to the AppKernel but add it before SyliusResourceBundle. To do that you need change the registerBundles like this:

public function registerBundles(): array
{
    $preResourceBundles = [
        new \Odiseo\SyliusBannerPlugin\OdiseoSyliusBannerPlugin(),
    ];

    $bundles = [
        ...
        //This plugin use the vich uploader bundle
        new \Vich\UploaderBundle\VichUploaderBundle(),
    ];

    return array_merge($preResourceBundles, parent::registerBundles(), $bundles);
}
  1. Import the configurations on your config.yml:
    - { resource: "@OdiseoSyliusBannerPlugin/Resources/config/config.yml" }
  1. Add the admin and shop routes:
odiseo_sylius_banner_admin:
    resource: "@OdiseoSyliusBannerPlugin/Resources/config/routing/admin.yml"
    prefix: /admin
    
odiseo_sylius_banner_shop:
    resource: "@OdiseoSyliusBannerPlugin/Resources/config/routing/shop.yml"
    prefix: /{_locale}/banner
  1. Finish the installation updatating the database schema and installing assets:
php bin/console doctrine:schema:update --force
php bin/console assets:install
php bin/console sylius:theme:assets:install

## Fixtures

This plugin comes with fixtures:

### Banners

Simply add this configuration on your fixture suite:

```yml
banner:
    options:
        banners_per_channel: 12

Test the plugin

You can follow the instructions to test this plugins in the proper documentation page: Test the plugin.

Credits

This plugin is maintained by Odiseo. Want us to help you with this plugin or any Sylius project? Contact us on team@odiseo.com.ar.