monsieurbiz / sylius-scripts-plugin
Allows you to add JS scripts from the admin panel.
Installs: 4 071
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Type:sylius-plugin
Requires
- php: ^8.0
- monsieurbiz/sylius-settings-plugin: ^1.0.0
- sylius/sylius: >=1.11 <1.14
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.16
- phpmd/phpmd: ^2.15
- phpspec/phpspec: ^7.0
- phpstan/phpstan: ^1.8.4
- phpstan/phpstan-doctrine: ^1.3.2
- phpstan/phpstan-webmozart-assert: ^1.1
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2025-01-02 13:17:40 UTC
README
Scripts Settings for Sylius
This plugin lets you add JS scripts from the admin panel. You can add scripts to the header or the footer of your website.
For example, add Google Analytics, Facebook Pixel, or any other tracking script.
Compatibility
Installation
If you want to use our recipes, you can configure your composer.json by running:
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
composer require monsieurbiz/sylius-scripts-plugin
Create the config file in config/packages/monsieurbiz_sylius_scripts_plugin.yaml
:
imports: resource: '@MonsieurBizSyliusScriptsPlugin/Resources/config/config.yaml'
Configuration
Go to the admin panel, then Settings
> Scripts
and add your scripts:
And that's it! Your scripts will be added:
How to
Change the default settings values for your project
Open the config/packages/monsieurbiz_sylius_scripts_plugin.yaml
file and change the default values. For example:
monsieurbiz_sylius_settings: plugins: monsieurbiz_scripts.scripts: default_values: before_head_end: | <script type="text/javascript">console.log('My script');</script>