Magento – How to customize navigation in Magento 2

magento2navigation

I am trying to modify the top navigation (the navigation that shows categories and subcategories as the main menu). I am using a free template(Ketty, from TemplateMonster) which in turn is based on Magento Blank Template. But, as i am very new to Magento, i am unable to figure out two things:

  1. How to change location of menu. Currently it is coming next to the logo and before the customer menu, search box and shopping cart. I want to move it down just below it, in it's own block / container. But i am unable to understand the positions mentioned. Where is menu called from? How is it rendered there?

  2. Is there a way to add other links from the CMS to the menu?

I tried looking around but, ,most are the resources are based on Magento 1.x hence could not find something substantial. Other issue is that I can't find enough time to read the documentation of Magento 2, which I am sure would provide all the answers, but due to lack of time, could not cover the length and breadth of the required section. Any help is much appreciated.

TIA.

Best Answer

To change a location of an element you can use: move

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
    <move element="product.info.review" destination="product.info.main" before="product.info.price"/>
</body>

Look here: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html#layout_markup_rearrange

To add additional Links to the Topmenu you should have a look here: Magento 2: How can I add External URL in top menu

or here: Adding a non-category link to the navigation links in magento 2