Sylius CMS
  • Introduction
  • Getting started
    • Installation
    • Your first page
  • Concepts
    • Templates
    • Blocks
    • Views
    • Pages
    • Assets
  • Upgrade
    • Upgrade to v0.6
  • Support & feedback
    • Contact
    • Feedback
Powered by GitBook
On this page
  • Installing the plugin
  • Enabling the plugin
  • Add configuration file
  • Include routes configuration
  • Update your database
  • Install assets
  1. Getting started

Installation

Before you can install the plugin you need a packagist token. You get a token once you buy the plugin. If you haven't done so yet, go to sylius-cms.com and hit the big buy button ;)

If you have Flex installed and just want the plugin installed with the default settings, go directly to Installing the plugin

Installing the plugin

Since the plugin is being provided through packagist.com you just have two steps to take before you can install the plugin:

1. Add repository to composer.json:

composer config repositories.private-packagist composer https://setono.repo.packagist.com/acme/

Remember to replace acme with the short name given to you.

2. Add token to composer auth:

composer config --global --auth http-basic.setono.repo.packagist.com token your_token

Remember to replace your_token with the token given to you.

Now you should be able to install the plugin using the normal composer require command:

composer require setono/sylius-cms-plugin

Enabling the plugin

If you have Flex enabled the composer require will automatically add the bundles and the plugin to bundles.php. If not you should manually add them:

    // ...

    Setono\SyliusCMSPlugin\SetonoSyliusCMSPlugin::class => ['all' => true],
    Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
    
    // ...

NOTICE: It's important that you add the plugin before the SyliusGridBundle.

Add configuration file

Create the file config/packages/setono_sylius_cms.yaml and add the following:

# config/packages/setono_sylius_cms.yaml
imports:
    - { resource: "@SetonoSyliusCMSPlugin/Resources/config/app/config.yaml" }

    # Uncomment next line if you want some default fixtures for this plugin
    # - { resource: "@SetonoSyliusCMSPlugin/Resources/config/app/fixtures.yaml" }

Include routes configuration

Create the file config/routes/setono_sylius_cms.yaml and add the following:

# config/routes/setono_sylius_cms.yaml
setono_sylius_cms:
    resource: "@SetonoSyliusCMSPlugin/Resources/config/routes.yaml"

The plugin also provides a routes file for non localized stores. All you do is to use @SetonoSyliusCMSPlugin/Resources/config/routes_no_locale.yaml instead of @SetonoSyliusCMSPlugin/Resources/config/routes.yaml

Update your database

Run the two following commands to create the tables needed for the CMS plugin:

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate

Install assets

php bin/console assets:install

You're good to go!

PreviousIntroductionNextYour first page

Last updated 2 years ago