-
Webpack
is an requirement for 2.0. This means Yarn is also an requirement. Because we don't commit compile assets anymore to this repository; we need an external compile tool to handle this job for us. In your ownpackage.json
file (your project) add the following scripts to your own project. After applying these changes you will be able to runyarn run build-cms
# package.json { "scripts": { "build-cms": "cd ./vendor/wearejust/sonata-theme-bundle && yarn && yarn run build", } }
# config.yml framework: assets: packages: backend: json_manifest_path: '%kernel.root_dir%/../public/bundles/wearejustsonatatheme/build/manifest.json'
Please bear in mind that if you use your project in a deploy pipeline (example: GitLab Pipelines) you don't forget to build these assets in this process.
-
The JS uses an modal which provides some new HTML. A new Controller has been added to make this feature work. Please add the following to your routing.
# routing.yml _wearejust_sonata_theme: resource: "@WearejustSonataThemeBundle/Resources/config/routing.yml"
<?php
// app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
// Before
new Just\SonataThemeBundle\JustSonataThemeBundle(),
// After
new Wearejust\SonataThemeBundle\WearejustSonataThemeBundle(),
);
// ...
}
// ...
}
This means also in the config.yml
you need to change the base config key. You need to change this only if you added some custom config in your app/config/config.yml
file for key just_sonata_theme
.
# app/config/config.yml
# Before:
just_sonata_theme:
# After
wearejust_sonata_theme:
-
Don't forget to add the new version to your own composer.json file
# composer.json { "require": { "wearejust/sonata-theme-bundle": "^2" } }
And run the following command:
composer update wearejust/sonata-theme-bundle --with-dependencies