shopro / sylius-hook-highlighter-plugin
Highlighting Twig hooks in your Sylius project.
Installs: 117
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 0
Forks: 0
Open Issues: 0
Language:Twig
Type:sylius-plugin
Requires
- php: ^8.2
- sylius/sylius: ^2.0
README
How to install:
composer require --dev shopro/sylius-hook-highlighter-plugin
Add this to config/bundles.php
:
<?php return [ // ...Your other bundles Shopro\SyliusHookHighlighterPlugin\SyliusHookHighlighterPlugin::class => ['dev' => true], ];
Create a file called config/packages/dev/hook_highlighter.yaml
:
imports: - { resource: "@SyliusHookHighlighterPlugin/config/config.yaml" }
You’re done.
How to use:
In the Sylius interface, you'll see a hook icon. This works in both admin and shop. When you click it, you'll enter 'highlight mode'. This allows you to select elements that are within hooks. If you click an element while in highlight mode, a popup will appear, giving you all the information you need to override or extend the hook.
If a hook is empty (having no hookables in it), it will show a hook icon. Clicking that will bring up a similar popup, with only the hook name.
Important:
This bundle only works in Sylius 2 or higher. Sylius 1 does not have Twig hooks.
This bundle is little more than some JS and a few Twig templates, but using it will make you much faster at extending hooks than manually perusing the HTML comments.