-
Notifications
You must be signed in to change notification settings - Fork 115
Setup
Ola Frankowska edited this page Aug 7, 2023
·
8 revisions
Run the following composer command:
composer require snowdog/module-menu
Run the following magento command:
bin/magento setup:upgrade
We don't provide CSS for menu templates. You can either add custom CSS os use themes, or extensions built on top of this module:
- Create a new menu in the admin area
Content > Elements > Menus
. - Add the created menu to a layout (for example:
Magento_Theme/layout/default.xml
):
<block
name="block-name"
class="Snowdog\Menu\Block\Menu"
>
<arguments>
<argument name="menu" xsi:type="string">
menu-id
</argument>
</arguments>
</block>
- Position it inside another block (parent).
- Replace:
-
block-name
with a descriptive name -
menu-id
with theid
of the menu.
-
- Render the menu inside the parent block template:
<?= $block->getChildHtml('block-name') ?>