Skip to main content

Questions tagged [topmenu]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

How to set custom menu items active in top menu depending on URL visited (menu caching issues)?

When I add custom menu items to the top menu (where product categories are placed) they are not set as active or are always active, depending on logic I implement for checking active state, no matter ...
player's user avatar
  • 33
0 votes
0 answers
32 views

Magento 2.4.6 - Main menu per category

Good day, We want to create better menu navigation for our customers in our Magento 2.4.6 shop. Our shop specializes in aftermarket suspension for vehicles in the “tuning” and “off-road” categories. ...
Marcel H.'s user avatar
  • 157
0 votes
3 answers
51 views

Hide Menu If Customer is not Logged In. And Show when Login

I want to hide the menu when user is not logged in. And Show when It Logs in. I did the following code. public function __construct( \Magento\Customer\Model\SessionFactory $customerSession, ...
Jasvir Singh's user avatar
0 votes
2 answers
44 views

Show different block with storeCode

I have this code for my horizontal menu and would like to show different blocks for the different storeViews. For example the StoreCode is EN i would like to show the block en-horzizontal-menu the ...
SERVISTO's user avatar
0 votes
0 answers
61 views

setup:upgrade resulted in multiple issues

I took over a developed magento shop and I was trying to solve an issue in which some products would not appear in frontend when navigating to its category (still haven't solved this either btw), so ...
Abi's user avatar
  • 33
0 votes
2 answers
725 views

How to sort menu items in the top menu in alphabetical order in magento2 frontend

Is there any way to sort menu items(Categories) showing in Magento in alphabetical order?
midhun's user avatar
  • 23
0 votes
1 answer
29 views

Issue in Mobile-View Category--after Overriding Block \Magento\Theme\Block\Html\Topmenu _getHtml() Function

*For adding Images in Top Menu Category,I have Override the _getHtml() Function from Block\Magento\Theme\Block\Html\Topmenu. *It's Working fine,But the issue is,On Mobile View for every ...
Chandra Sekhar's user avatar
2 votes
2 answers
1k views

How to Add a Link to the Top Menu in Magento 2?

I am want to know how to add programmatically a new link (to the main top menu in the header) with a submenu. How to achieve that, via XML or via (PHP) plugin? Thanks in advance.
Kuldeep Sharma's user avatar
0 votes
2 answers
529 views

How to show all categories under the static text in frontend Menu in MAgento2

How to display all categories under the static text in frontend Menu in Magento2 Example: We have 3 categories created in admin and displaying like below in frontend Menu 1 Menu 2 Menu 3 We need to ...
Sudheer Singamsetti's user avatar
1 vote
0 answers
409 views

How to extend app/code/Smartwave/Megamenu/Block/Topmenu.php this file Function in Custom Module or in Child Theme?

I need to extend a function from this file app/code/Smartwave/Megamenu/Block/Topmenu.php. By using a module or in child theme. How can i achieve that to extend that file like how to modify that ...
Prits's user avatar
  • 625
0 votes
1 answer
29 views

Add into Top Link - My Downloadable Products

I need to add a link to the top.links block that links to My Downloadable Products and translate it to My Favourite Product, can you tell me if this possible. <referenceBlock name="top.links&...
Lerry's user avatar
  • 69
0 votes
1 answer
434 views

How to override _getHtml() function form topmenu.php file in Magento 2

I want to override _getHtml() function from topmenu.php file using block. So Please help me THANKS.
Mohit Patel's user avatar
  • 3,923
0 votes
2 answers
413 views

How to add a title to sidebar in Magento 2?

I have moved my navigation menu to the sidebar by using <move element="catalog.topnav" destination="sidebar.main" before="catalog.leftnav"/> I wonder if I can add ...
Magento_learner's user avatar
1 vote
0 answers
101 views

Magento Category Navigation - Customising Topmenu.php, adding columns using "$colBrakes" + "shouldAddNewColumn"?

I am successfully customising the magento 2 navigation by extending 'vendor/magento/module-theme/Block/Html/Topmenu.php' (and also 'vendor/magento/module-theme/view/frontend/templates/html/topmenu....
00-BBB's user avatar
  • 166
0 votes
2 answers
419 views

How to override top menu and add icon in Magento 2?

How to override top menu and add icon in Magento 2? I'm using Magento v2 and want to have icons added to each category menu item.? How can I override this? I added the Attribute for icon in category (...
SNS's user avatar
  • 905
1 vote
1 answer
335 views

How to create custom space block below catalog.topnav ( Menu )

I want to add add-to-cart and Wishlist under catalog.topnav ( Menu ) how to add right below menu bar.
zus's user avatar
  • 175
0 votes
2 answers
340 views

I want to show the topmenu only when logged in

I want to show the topmenu only when a customer is logged in and I need to use the FPC. When I try to retrieve the customer id with function to create a if statement to see if the customer is logged ...
Rene Donkers's user avatar
0 votes
1 answer
614 views

Magento 2 : Add "View All" Link after all sub categories

How to display "View All" Link after all sub categories in Magento 2. I used this blog. But, It's display main menu and sub menu. I want to add "View All" in all sub categories ...
Ankita Patel's user avatar
0 votes
1 answer
43 views

There has been an error processing your request. In Maganto category 2 category section

Notice: Undefined property: Plazathemes\Override\Controller\Adminhtml\Category\Edit\Interceptor::$storeManager in /home/e7iys871maju/public_html/thehighstreet/app/code/Plazathemes/Override/Controller/...
Chandan Jha's user avatar
0 votes
1 answer
56 views

How to extend the topmenu.php block in magento2

I'm trying to extend the topmenu.php block to make some modifications but it doesn't work for me. I already created my custom module. Can someone help me by explaining how I can do it?
Andres Higuita's user avatar
1 vote
1 answer
102 views

Top navigation menu merge with accout button

New to Magento 2, so sorry if I'm asking silly question, but i really need some help here. My boss wanted to create a new website using the new Magento 2.3 for his company. So we bought hosting, ...
Stefy's user avatar
  • 13
0 votes
1 answer
298 views

Overriding _getHtml function in topmenu.php makes navbar disappear

I'm trying to override the __getHtml function in topmenu.php class Topmenu extends \Magento\Theme\Block\Html\Topmenu { protected function _getHtml( \Magento\Framework\Data\Tree\Node $...
hardy123480's user avatar
1 vote
1 answer
3k views

Add custom menu links only to mobile menu layout

I am using Magento 2.2.2 and I am trying to add some custom menu links to magento in the mobile menu layout. I tried adding a custom block with menu links by referring catalog.topnav block default....
Kaushik Kumar Roy's user avatar
1 vote
0 answers
451 views

Sort Menu items in aphabetical order magento 2 in observer

I am creating menu items in magento 2. I is working fine and generated according to category order in admin dashboard. But I wanted to sort the menu items alphabetically on store front ir-respective ...
Ghulam Akbar's user avatar
0 votes
1 answer
282 views

Magento 2: Topmenu 4th level categories out of place

I use Magento 2 (Version 2.3.2) with standard luma theme. If i navigate the topmenu down to the 3rd level and hover over some category, that opens up the 4th level, i often cant reach the 4th level ...
user85702's user avatar
0 votes
2 answers
810 views

Add a custom navbar menu

I am trying to add a custom link(contact us) in navbar menu and wanted to add the contact us page link. how to add that?
Chandan Sayed's user avatar
0 votes
1 answer
85 views

Top navigation menu without dropdown

Magento 2.3.3, custom theme based on Blank. It's a very small store with only two categories. I want to display them in the top navigation menu without a dropdown menu. In other words, just a ...
Reviresco's user avatar
0 votes
3 answers
623 views

How to display category image in Megamenu?

I want to display the category image in mega menu(which we have created using html) but not success. I have no idea, how to make this work so I'm here and hoping someone can help me with this. ...
Siva's user avatar
  • 1,120
0 votes
1 answer
380 views

How to load Category image in top menu?

I have loaded the category and sub-category, now I need to load image as well but I'm not sure how to do that. Below is the code I have used: In block file: public function getStoreCategories($...
MagentoDev's user avatar
1 vote
1 answer
621 views

How to get sub category of sub category?

I have to load parent category, sub category and its sub categories. As of now, I can able to load the parent and its sub category but I have no idea how to load its sub category. Below is the code I ...
MagentoDev's user avatar
1 vote
2 answers
1k views

Magento2.3: How to get sub category for parent category?

I have installed Magento2.3.2 EE on local. I have seen that the default category menu is not working correctly so that we want to load category and subcategory collection at top menu position with our ...
MagentoDev's user avatar
0 votes
1 answer
2k views

Magento2: How to load category collection?

I have to load the category collection and show it on top menu position on my Magento site. I have tried object manager concept but it's not correct method to follow so that I have to load it using ...
MagentoDev's user avatar
1 vote
0 answers
524 views

Magento 2 - Move Sign Out link at the last position in customer menu dropdown

I want to move authorization-link at the last position in customer menu. How can I achieve that? UPDATE: Code from xml <referenceBlock name="top.links"> <referenceBlock name="...
Sejal Shah's user avatar
  • 2,153
0 votes
1 answer
164 views

How can I add brands and flavors in navigation menu with categories?

I want to show categories of items also want to show the brands and flavors of item according to the parent it has.
Izhar Mehdi's user avatar
0 votes
0 answers
36 views

Topmenu override declaration error Magento 2.3

Topmenu override declaration getting error in Magento 2.3
Umesh Makwana's user avatar
2 votes
1 answer
469 views

Magento 2 dropdown not showing

In my catalog I have some categories and subcategories with product. But in my top nav I don't have any dropdown. What I have missed ?
n44s's user avatar
  • 198
10 votes
3 answers
3k views

Magento 2.3 - Topmenu tabs with wrong (cached) 'active' class

I have a small menu problem. The active tabs do not match the active class. If I disable the static_block cache it works again, so it actually looks like the menu is cached and continues to display ...
arno's user avatar
  • 348
2 votes
1 answer
910 views

Magento 2 Custom cache for top menu

I want to create custom cache for top menu For this I have created cache.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Shoaib Munir's user avatar
  • 9,522
0 votes
1 answer
590 views

How to customise category top menu navigation by custom category id in Magento 2?

By default Magento 2 showing the all store categories in top menu with a tree structure, I want to filter with custom category ids and only that filtered category need to show in category top menu ...
Jaimin Patel's user avatar
1 vote
0 answers
273 views

How to set custom Dropdown on Top Menu in Magento 2

I want to set my custom div on my custom Brands link in Top Menu like I create my custom link in Top Menu the code is <?php namespace Vender\Module\Plugin\Block; use Magento\Framework\Data\...
Asad Khan's user avatar
  • 1,486
2 votes
0 answers
380 views

How to set Drop Down menu on mouse hover in TopMenu. Magento 2

How to set custom item in TopMenu to show DropDown menu on mouse hover I tried this code app/code/StackExchange/Menu/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/...
Asad Khan's user avatar
  • 1,486
0 votes
0 answers
134 views

Magento2 Which table store category ascending order or descending order store category

My project category and sub category I have set ascending order or descending order store category via script or sql query. Magento2 Which table store category & sub category ascending order or ...
MehulKanjariya's user avatar
1 vote
0 answers
63 views

Magento 2.3.1 Multiple categories showing active, How to remove duplicate active class?

In my instance, I have updated Magento 2.3.1 from 2.3.0. I have an issue that more than one categories are showing active on each page. it shows randomly selected more than one categories. How ...
Utsav Gupta's user avatar
  • 1,243
2 votes
1 answer
978 views

Move top menu bar to left side in Magento 2

I want to move the top menu bar to left sidebar I have written this code <move element="catalog.topnav" destination="header-wrapper" after="block-search"/> Through this code it is moving in ...
Ashish Ramchandani's user avatar
1 vote
1 answer
276 views

show top menu bar to left side in magento2

I want to replace the top menu bar to the left side i have written this code in my theme default.xml <body> <referenceContainer name="sidebar.main"> <block class="Magento\Framework\...
Ashish Ramchandani's user avatar
1 vote
1 answer
494 views

Magento 2 : How to show a menu in header part?

I want to show a menu in header part in magento 2? please help me how to add in header part?
sanni kalariya's user avatar
1 vote
2 answers
584 views

How to start top menu by some specific category in magento 2

How to start top menu by some specific category ID in magento 2. Something like this in topmenu.phtml <?php $categoryID = 6; $_menu = $block->getHtml('level-top', 'submenu', $columnsLimit, $...
Waqar's user avatar
  • 974
0 votes
1 answer
235 views

show a custom attribute instead of full name if customer logged in M2

I want to display in top menu my custom attribute instead of full name customer, I tried to override customer.phtml under design my theme but no result please any help <? $objectManager =...
Developper Magento 's user avatar
0 votes
1 answer
168 views

Magento 2.2.5 Show customer header links in Category navigation menu

In Magento 2.2.5, Is there any way to display the top customer header links in Category navigation menu. Like this
Saravanan DS's user avatar
  • 1,126
0 votes
2 answers
888 views

Magento 2.3 menu static block as dropdown

Currently in Magento 2.3 the dropdown menu only can show the subcategories. I want to change this so that the subcategories are not displayed but only a specific static block. Inside that block I ...
JGeer's user avatar
  • 1,420