Magento Forum - UK Magento Forum (Unofficial)

An unofficial but dedicated Magento Forum for Magento Users, Designers and Developers

Magento 2: put all CMS pages in the top bar

A forum for web designers working with the Magento system.

Magento 2: put all CMS pages in the top bar

Postby Ajax30 » Wed Oct 25, 2017 3:07 pm

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="-">
     <arguments>
       <argument name="parent_item_class" xsi:type="string">dropdown</argument>
       <argument name="submenu_class" xsi:type="string">dropdown-menu</argument>
     </arguments>
  </block>
</container>


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!
Ajax30
 
Posts: 4
Joined: Wed Oct 25, 2017 12:15 pm

Return to Magento Designers

cron