From d2ee9111e05cf6033f683bc30f4cedbed69f6167 Mon Sep 17 00:00:00 2001 From: Wojdylak Date: Wed, 20 Nov 2024 09:59:53 +0100 Subject: [PATCH] [Maintenance] Add app webpack endpoint to twig hooks --- assets/admin/entry.js | 1 + assets/shop/entry.js | 1 + config/packages/_sylius.yaml | 19 +++++++++++++++++++ templates/admin/javascripts.html.twig | 2 ++ templates/admin/stylesheets.html.twig | 1 + templates/shop/javascripts.html.twig | 1 + templates/shop/stylesheets.html.twig | 1 + 7 files changed, 26 insertions(+) create mode 100644 templates/admin/javascripts.html.twig create mode 100644 templates/admin/stylesheets.html.twig create mode 100644 templates/shop/javascripts.html.twig create mode 100644 templates/shop/stylesheets.html.twig diff --git a/assets/admin/entry.js b/assets/admin/entry.js index 8acf2c2aa0..746e34cfc0 100644 --- a/assets/admin/entry.js +++ b/assets/admin/entry.js @@ -1 +1,2 @@ // In this file you can import assets like images or stylesheets +console.log('Hello Webpack Encore! Edit me in assets/shop/entry.js'); diff --git a/assets/shop/entry.js b/assets/shop/entry.js index 8acf2c2aa0..746e34cfc0 100644 --- a/assets/shop/entry.js +++ b/assets/shop/entry.js @@ -1 +1,2 @@ // In this file you can import assets like images or stylesheets +console.log('Hello Webpack Encore! Edit me in assets/shop/entry.js'); diff --git a/config/packages/_sylius.yaml b/config/packages/_sylius.yaml index d188419cb8..4770040f9c 100644 --- a/config/packages/_sylius.yaml +++ b/config/packages/_sylius.yaml @@ -46,6 +46,7 @@ sylius_channel: channel: classes: model: App\Entity\Channel\Channel + sylius_core: resources: avatar_image: @@ -138,6 +139,7 @@ sylius_payum: payment_security_token: classes: model: App\Entity\Payment\PaymentSecurityToken + sylius_product: resources: product: @@ -246,6 +248,7 @@ sylius_taxonomy: translation: classes: model: App\Entity\Taxonomy\TaxonTranslation + sylius_user: resources: admin: @@ -260,3 +263,19 @@ sylius_user: user: classes: model: App\Entity\User\UserOAuth + +sylius_twig_hooks: + hooks: + 'sylius_admin.base#stylesheets': + app_styles: + template: 'admin/stylesheets.html.twig' + 'sylius_admin.base#javascripts': + app_javascripts: + template: 'admin/javascripts.html.twig' + + 'sylius_shop.base#stylesheets': + app_styles: + template: 'shop/stylesheets.html.twig' + 'sylius_shop.base#javascripts': + app_javascripts: + template: 'shop/javascripts.html.twig' diff --git a/templates/admin/javascripts.html.twig b/templates/admin/javascripts.html.twig new file mode 100644 index 0000000000..0c21379ab3 --- /dev/null +++ b/templates/admin/javascripts.html.twig @@ -0,0 +1,2 @@ + +{{ encore_entry_script_tags('app-admin-entry', null, 'app.admin') }} diff --git a/templates/admin/stylesheets.html.twig b/templates/admin/stylesheets.html.twig new file mode 100644 index 0000000000..dc98d75101 --- /dev/null +++ b/templates/admin/stylesheets.html.twig @@ -0,0 +1 @@ +{{ encore_entry_link_tags('app-admin-entry', null, 'app.admin') }} diff --git a/templates/shop/javascripts.html.twig b/templates/shop/javascripts.html.twig new file mode 100644 index 0000000000..a659c2c1d0 --- /dev/null +++ b/templates/shop/javascripts.html.twig @@ -0,0 +1 @@ +{{ encore_entry_script_tags('app-shop-entry', null, 'app.shop') }} diff --git a/templates/shop/stylesheets.html.twig b/templates/shop/stylesheets.html.twig new file mode 100644 index 0000000000..b439fca170 --- /dev/null +++ b/templates/shop/stylesheets.html.twig @@ -0,0 +1 @@ +{{ encore_entry_link_tags('app-shop-entry', null, 'app.shop') }}