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! 😘 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' 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 @@