From 78464205eb3e2af44cf3f8d6c69d7f5863a289f0 Mon Sep 17 00:00:00 2001 From: Etienne Gutbub Date: Mon, 5 Feb 2024 17:24:26 +0100 Subject: [PATCH 1/3] fix(Fixtures): correct link attributes in fixtures on menuItem instead of translation --- src/Fixture/MenuFixture.php | 8 ++++---- src/Resources/config/sylius/fixtures.yaml | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Fixture/MenuFixture.php b/src/Fixture/MenuFixture.php index e790c26..a5e970a 100644 --- a/src/Fixture/MenuFixture.php +++ b/src/Fixture/MenuFixture.php @@ -41,13 +41,13 @@ public function configureResourceNode(ArrayNodeDefinition $resourceNode): void ->children() ->scalarNode('label')->cannotBeEmpty()->end() ->scalarNode('url')->defaultValue('')->end() - ->booleanNode('targetBlank')->defaultFalse()->end() - ->booleanNode('noreferrer')->defaultFalse()->end() - ->booleanNode('noopener')->defaultFalse()->end() - ->booleanNode('nofollow')->defaultFalse()->end() ->end() ->end() ->end() + ->booleanNode('targetBlank')->defaultFalse()->end() + ->booleanNode('noreferrer')->defaultFalse()->end() + ->booleanNode('noopener')->defaultFalse()->end() + ->booleanNode('nofollow')->defaultFalse()->end() ->variableNode('children')->cannotBeEmpty()->defaultValue([])->end() ->end() ->end() diff --git a/src/Resources/config/sylius/fixtures.yaml b/src/Resources/config/sylius/fixtures.yaml index b638074..9a464e5 100644 --- a/src/Resources/config/sylius/fixtures.yaml +++ b/src/Resources/config/sylius/fixtures.yaml @@ -122,6 +122,10 @@ sylius_fixtures: fr_FR: label: 'Nous contacter' url: 'https://%env(SYLIUS_FIXTURES_HOSTNAME)%/#' + targetBlank: true + noreferrer: true + noopener: true + nofollow: true - translations: en_US: label: 'FAQs' From 731b82ce574f46816cd3ccdac3b9d2993be8530c Mon Sep 17 00:00:00 2001 From: Etienne Gutbub Date: Mon, 5 Feb 2024 17:25:13 +0100 Subject: [PATCH 2/3] feat(Footer Menu): Use link attributes in footer templates --- .../views/Layout/Footer/Grid/_customer_care.html.twig | 10 +++++++++- .../views/Layout/Footer/Grid/_your_store.html.twig | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Resources/views/Layout/Footer/Grid/_customer_care.html.twig b/src/Resources/views/Layout/Footer/Grid/_customer_care.html.twig index 4b03bcd..b6b31f3 100644 --- a/src/Resources/views/Layout/Footer/Grid/_customer_care.html.twig +++ b/src/Resources/views/Layout/Footer/Grid/_customer_care.html.twig @@ -4,7 +4,15 @@

{{ 'sylius.ui.customer_care'|trans }}

diff --git a/src/Resources/views/Layout/Footer/Grid/_your_store.html.twig b/src/Resources/views/Layout/Footer/Grid/_your_store.html.twig index bd38140..b345a61 100644 --- a/src/Resources/views/Layout/Footer/Grid/_your_store.html.twig +++ b/src/Resources/views/Layout/Footer/Grid/_your_store.html.twig @@ -4,7 +4,15 @@

{{ 'sylius.ui.your_store'|trans }}

From f08bd79c15087736bfe6f798e7922274179a8cb9 Mon Sep 17 00:00:00 2001 From: Etienne Gutbub Date: Mon, 5 Feb 2024 17:45:47 +0100 Subject: [PATCH 3/3] docs(readme): Update README about customizing front --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index d03bc37..6d64fc0 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,13 @@ If you want to customize your menu, like adding an image, do so by overriding th The front view is exactly the same as the default one. +## Customize front view + +A menu can look very differently depending on where it should be displayed so most of the time you will need to create your own macro for the menu items. +A good place to start is the template of the main menu here: ```src/Resources/views/Layout/Header/_menu.html.twig``` where we define a macro for the menu items, and we use them directly in the template. + +To get the first items of a menu you can call our custom twig function ```menu_first_level('main')``` where `main` is the code of the menu we want to retrieve. + ## Contributing You can open an issue or a Pull Request if you want! 😘