Accessibility Widget: Installation and Operation
Accessibility widget for Sylius - installation via Composer (Packeton), setup command, update, uninstall in the right order
Accessibility Widget: Installation and Operation
Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net
Installation
The repository is private and served through Packeton (
https://packeton.markus-michalski.net). You receive the credentials after purchasing a license or once access has been granted.
{ "repositories": [{ "type": "composer", "url": "https://packeton.markus-michalski.net" }] }
composer require mmd/sylius-accessibility-plugin
-
Register the bundle in
config/bundles.php:Mmd\SyliusAccessibilityPlugin\MmdSyliusAccessibilityPlugin::class => ['all' => true], -
Import the admin routes, for example in
config/routes/mmd_sylius_accessibility.yaml:mmd_sylius_accessibility_admin: resource: "@MmdSyliusAccessibilityPlugin/config/routes/admin.yaml" -
Run the setup command and publish the assets:
bin/console mmd:accessibility:setup bin/console assets:install publicmmd:accessibility:setupruns only this plugin's open migrations (exactly one at present, for the tablemmd_sylius_accessibility_channel_settings), never those of your application or of other plugins. The command is idempotent: without a new migration nothing happens, not even after acomposer update. If Sylius' own migrations are still open it aborts and tells you to rundoctrine:migrations:migratefirst. It also checks that the routes from step 2 are imported and prints the matching snippet otherwise - it never writes into yourconfig/directory itself. Run it as the same user as your other console commands; in scripts add--no-interaction. The classicdoctrine:migrations:migratestill works as an alternative.The scripts and the stylesheet are always served from
<base path>/bundles/mmdsyliusaccessibilityplugin/, never throughasset()or Sylius themes.assets:installis enough,sylius:theme:assets:installis not needed.Content Security Policy: Allow
'self'inscript-src. If the colour filter is active in a channel, the plugin also prints the filter rules as an inline<style>;style-srcneeds a nonce or hash for it.
As long as you do not enable a channel in the admin, the widget shows nothing (see Configuration). The admin grid, Twig hooks, the Shop API resource and the Doctrine mapping register themselves; there are no shop routes, the plugin has none. The bundle has no YAML configuration, all settings are stored in the database.
Update
composer update mmd/sylius-accessibility-plugin
bin/console mmd:accessibility:setup --no-interaction
bin/console assets:install public
bin/console cache:clear
Running the setup command again after every update is harmless: without a new migration nothing happens.
Uninstall
The order matters because Doctrine only knows the migration while the bundle is still registered:
-
Remove your own overrides of plugin templates (for example
skip_target.html.twig). -
While the bundle is still registered, roll the migration back:
bin/console doctrine:migrations:execute --down 'Mmd\SyliusAccessibilityPlugin\Migrations\Version20261003140000' -
Remove the route import and the bundle entry from
config/bundles.php, then:composer remove mmd/sylius-accessibility-plugin bin/console assets:install publicThe last call removes the copied assets again.
Alternatively you can drop the table
mmd_sylius_accessibility_channel_settingsby hand instead of rolling the migration back. You then also have to remove the rowMmd\SyliusAccessibilityPlugin\Migrations\Version20261003140000fromdoctrine_migration_versions.