Page 1 of 1

Magento 2: put all CMS pages in the top bar

PostPosted: Wed Oct 25, 2017 3:07 pm
by Ajax30
I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank.

By default, it seems, Magento displays links to the product categories (and subcategories) in the top bar. I need to display only the CMS (static) pages there.

The code from default.xml that displays the top bar is:

Code: Select all
<container name="navbar-collapse" htmlTag="div" htmlClass="collapse navbar-collapse" htmlId="wg-navbar-collapse">
  <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml" ttl="3600" before="-">
       <argument name="parent_item_class" xsi:type="string">dropdown</argument>
       <argument name="submenu_class" xsi:type="string">dropdown-menu</argument>

Replacing catalog.topnav with cms.topnav did not produce any change in the frontend. I could not find a way to do that through the admin either.

I could not find a way to do that through the admin. How must I do it?

Thank you!