Skip to content

shinyvision/sylius-hook-highlighter-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sylius Hook Highlighter Plugin

Screenshot

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.

About

Highlighting Twig hooks in your Sylius project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published