Markus Michalski FAQ

Accessibility Widget: Extending

Accessibility widget for Sylius - public interfaces to decorate, template override point, classes marked internal

Deutsche Version

Back to overview

Accessibility Widget: Extending

Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net

Public extension points

Service / interface Purpose
WidgetConfigResolverInterface (mmd_sylius_accessibility.widget_config_resolver) Resolves the configuration for a channel code and returns null when nothing is to be shown; decoratable, for example to connect a source other than the plugin's own table
ChannelSettingsRepositoryInterface (mmd_sylius_accessibility.channel_settings_repository) Reads/writes the channel row (findOneByChannelCode, save); decoratable for your own caching strategies
skip_target.html.twig Override point if your theme places the content area elsewhere: templates/bundles/MmdSyliusAccessibilityPlugin/shop/skip_target.html.twig in your application (see Storefront Integration)

The Twig hooks from Storefront Integration can be adjusted with the usual Sylius Twig Hooks mechanisms, for example to render the widget somewhere else.

Internal classes

ChannelSettingsFormType, AdminMenuListener and AccessibilityTwigExtension (Twig functions mmd_accessibility_config, mmd_accessibility_asset_url, mmd_accessibility_plugin_version) are marked @internal in the source: they are not part of the extension API and may change in a minor release. Do not build against their constructor signatures.

The ChannelSettings entity implements ChannelSettingsInterface (Sylius ResourceInterface) and is not final, so it follows the usual Sylius pattern for custom resources.