Skip to content

Commit ef765b7

Browse files
authored
Add sylius events for app's styles and scripts (#38)
2 parents 9c84984 + 2115a4f commit ef765b7

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

config/packages/sylius_ui.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
sylius_ui:
2+
events:
3+
sylius.admin.layout.stylesheets:
4+
blocks:
5+
app_styles:
6+
template: "admin/styles.html.twig"
7+
priority: -10
8+
sylius.admin.layout.javascripts:
9+
blocks:
10+
app_scripts:
11+
template: "admin/scripts.html.twig"
12+
priority: -10
13+
14+
sylius.shop.layout.stylesheets:
15+
blocks:
16+
app_styles:
17+
template: "shop/styles.html.twig"
18+
priority: -10
19+
sylius.shop.layout.javascripts:
20+
blocks:
21+
app_scripts:
22+
template: "shop/scripts.html.twig"
23+
priority: -10

config/packages/twig.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
twig:
22
paths: ['%kernel.project_dir%/templates']
33
debug: '%kernel.debug%'
4+
default_path: '%kernel.project_dir%/../../../tests/TestApplication/templates'
45
strict_variables: '%kernel.debug%'
56

67
services:

templates/admin/scripts.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ encore_entry_script_tags('app-admin-entry', null, 'app.admin') }}

templates/admin/styles.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ encore_entry_link_tags('app-admin-entry', null, 'app.admin') }}

templates/shop/scripts.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ encore_entry_script_tags('app-shop-entry', null, 'app.shop') }}

templates/shop/styles.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ encore_entry_link_tags('app-shop-entry', null, 'app.shop') }}

0 commit comments

Comments
 (0)