Magento – Magento2 Max Depth Top Category Navigation

categorymagento-2.1topmenu

Changing the max depth in the admin section does not apply to the frontend.

Anyone has done a workaround to display just the first-level categories in the top menu?

Best Answer

As a workaround you can set in the default.xml in your theme Magento_Theme folder:

<referenceBlock name="catalog.topnav">
    <arguments>
        <argument name="columns_limit" xsi:type="string">1</argument>
    </arguments>
</referenceBlock>

With this, you can determine the depth of the menu. Magento will still render the <ul></ul> but with some styling, you can remove this.

still not the most beautiful solution, but will be fixed in future Magento releases.

Related Topic