Skip to content

Commit

Permalink
Add template event block for layout topbar
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Dec 27, 2019
1 parent 05c9e8f commit fe39bc1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 10 deletions.
17 changes: 17 additions & 0 deletions src/Sylius/Bundle/ShopBundle/Resources/config/app/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,20 @@ liip_imagine:

sonata_block:
default_contexts: ~

sylius_ui:
events:
sylius.shop.layout.topbar:
blocks:
before_switchers_legacy:
template: "@SyliusShop/Block/Layout/_beforeSwitchersLegacy.html.twig"
currency_switcher:
template: "@SyliusShop/Block/Layout/_currencySwitcher.html.twig"
locale_switcher:
template: "@SyliusShop/Block/Layout/_localeSwitcher.html.twig"
before_security_widget_legacy:
template: "@SyliusShop/Block/Layout/_beforeSecurityWidgetLegacy.html.twig"
security_widget:
template: "@SyliusShop/Block/Layout/_securityWidget.html.twig"
after_security_widget_legacy:
template: "@SyliusShop/Block/Layout/_afterSecurityWidgetLegacy.html.twig"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ sonata_block_render_event('sylius.shop.layout.after_security_widget') }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ sonata_block_render_event('sylius.shop.layout.before_security_widget') }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ sonata_block_render_event('sylius.shop.layout.before_currency_switcher') }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ render(controller('sylius.controller.shop.currency_switch:renderAction')) }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ render(controller('sylius.controller.shop.locale_switch:renderAction')) }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ render(controller('sylius.controller.shop.security_widget:renderAction')) }}
11 changes: 1 addition & 10 deletions src/Sylius/Bundle/ShopBundle/Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,7 @@
<div class="pusher">
{% block top %}
<div id="menu" class="ui large sticky inverted stackable menu">
{{ sonata_block_render_event('sylius.shop.layout.before_currency_switcher') }}

{{ render(controller('sylius.controller.shop.currency_switch:renderAction')) }}
{{ render(controller('sylius.controller.shop.locale_switch:renderAction')) }}

{{ sonata_block_render_event('sylius.shop.layout.before_security_widget') }}

{{ render(controller('sylius.controller.shop.security_widget:renderAction')) }}

{{ sonata_block_render_event('sylius.shop.layout.after_security_widget') }}
{{ sylius_template_event('sylius.shop.layout.topbar') }}
</div>
{% endblock %}

Expand Down

0 comments on commit fe39bc1

Please sign in to comment.