cancel
Showing results for 
Search instead for 
Did you mean: 

Showing static block on navigation

SOLVED
   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Showing static block on navigation

I want to show static block on frontend navigation.

 

As i want to show some static links there.

So can anybody please help me with this.

 

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Showing static block on navigation

Hi @akashay _kc 

 

for this you have to create a static block from admin in admin->content->block.

 

After that just go to your theme and inside Magento_Theme->layout->default.xml add the below code.

 

<referenceContainer name="catalog.topnav">
            <block class="Magento\Cms\Block\Block" name="header.top.menu" before="-"> <!--Where header.top.menu - block name (optional)-->	
                <arguments>
                    <argument name="block_id" xsi:type="string">header_menu</argument> <!--Where header_menu - CMS block identifier, that you will create in the admin panel -->
                </arguments>
               </block>
</referenceContainer>

After that flush the cache and check the result.

 

Thanks

View solution in original post

2 REPLIES 2

Re: Showing static block on navigation

Hi @akashay _kc 

 

for this you have to create a static block from admin in admin->content->block.

 

After that just go to your theme and inside Magento_Theme->layout->default.xml add the below code.

 

<referenceContainer name="catalog.topnav">
            <block class="Magento\Cms\Block\Block" name="header.top.menu" before="-"> <!--Where header.top.menu - block name (optional)-->	
                <arguments>
                    <argument name="block_id" xsi:type="string">header_menu</argument> <!--Where header_menu - CMS block identifier, that you will create in the admin panel -->
                </arguments>
               </block>
</referenceContainer>

After that flush the cache and check the result.

 

Thanks

Re: Showing static block on navigation

Thanks it is working fine.