Add Link Navigation Menu Magento 2

You can add a non-category link to the navigation menu by adding the below lines in layout xml file.

<referenceContainer name="navigation.sections">
 <block class="Magento\Framework\View\Element\Html\Links" name="mylink">
 <arguments>
 <argument name="label" xsi:type="string">Mylink</argument>
 <argument name="path" xsi:type="string">mypath</argument>
 <argument name="css_class" xsi:type="string">mycss</argument>
 </arguments>
 </block>
</referenceContainer>
Share