Skip to content
Ola Frankowska edited this page Aug 7, 2023 · 8 revisions

Composer installation

Run the following composer command:

composer require snowdog/module-menu

Setup the module

Run the following magento command:

bin/magento setup:upgrade

Important note about styling

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:

Creating menu and displating it on frontend

  1. Create a new menu in the admin area Content > Elements > Menus.
  2. 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 the id of the menu.
  1. Render the menu inside the parent block template:
<?= $block->getChildHtml('block-name') ?>
Clone this wiki locally