30 votes

Magento 2 remove My Account and Wishlist link from top links

for me after adding referenceBlock then worked. Tested <referenceBlock name="top.links"> <referenceBlock name="register-link" remove="true" /> <!--for Create ...
Qaisar Satti's user avatar
  • 32.5k
25 votes

How to add or remove header.links in magento2?

I Hope this is useful for you, if you want to remove top.links Add default.xml file in this path app/design/frontend/vendor/theme/Magento_Theme/layout/default.xml <page xmlns:xsi="...
Rajkumar .E's user avatar
  • 3,570
11 votes
Accepted

Remove Sign in and Create account links from header Magento 2

Use below code for remove sign in link <referenceBlock name="authorization-link-login" remove="true" />
Ansar Husain's user avatar
  • 3,409
9 votes

How to add or remove header.links in magento2?

You can add and remove top links by add this line in your in Magento_Theme/layout/default.xml <referenceBlock name="header.links"> <block class="Magento\Framework\View\Element\Html\...
Bilal Usean's user avatar
  • 9,977
9 votes
Accepted

Magento 2 : How to check multiple if config in layout?

ifconfig supports only one value. In order to solve your problem, I suggest creating your own block that extends Magento\Framework\View\Element\Html\Link and add the conditions in the _toHtml method. ...
Marius's user avatar
  • 198k
7 votes
Accepted

Magento 2: move the top links in the same container as the logo

Remove Compare Products link: Theme_Root/Magento_Catalog/layout/default.xml <referenceBlock name="catalog.compare.link" remove="true" /> Remove Default welcome message: Theme_Root/...
Evgeny Levinsky's user avatar
7 votes
Accepted

Magento 2 - add link with content to top menu

You can add elements to the top menu using the event page_block_html_topmenu_gethtml_before. Step 1 - So you need to create a module with these files (all the files should be in app/code/[Namespace]/[...
Shireen N's user avatar
  • 946
6 votes

Adding CSS & Target attribute to custom top links in default.xml Magento 2

As circlesix mentioned already, in /vendor/magento/framework/View/Element/Html/Link/Current.php you can see that there is another argument called @method null|array ...
itweb Thomas's user avatar
6 votes

how to show my account link in header after successfully login in magento 2.0

Use the following code to show your account link in header: <?php $objectManagerlogin = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $objectManagerlogin->get('...
Abhinav Singh's user avatar
5 votes

how to show my account link in header after successfully login in magento 2.0

Take a look at the places where Magento does this already. If you take a look at the customer modules default.xml: vendor/magento/module-customer/view/frontend/layout/default.xml You will see a call ...
circlesix's user avatar
  • 4,273
5 votes

Remove Specific Top Links

You can use <!-- Removes 'Log Out' link--> <reference name="top.links"> <action method="removeLinkByUrl"> <url helper="customer/getLogoutUrl"/> <...
Rafael Corrêa Gomes's user avatar
5 votes
Accepted

Magento 2 : How can i add Icons to the user links such as "My account" Login" Sign in etc

You have to pass an arguments in default.xml for add class in account link: <block class="Magento\Customer\Block\Account\Link" name="my-account-link"> <arguments> <argument ...
Dipesh Rangani's user avatar
5 votes
Accepted

Removing wishlist link - top header magento 2

app/design/frontend/vendorName/themeName/Magento_Wishlist/layout/default.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
WaPoNe's user avatar
  • 1,590
5 votes

how to remove text "items" from top links wishlist magento 2

You can override the phtml: Theme_Root/Magento_Wishlist/templates/link.phtml Instead this: <span data-bind="text: wishlist().counter" class="counter qty"></span> You can do this: <...
David Motilla's user avatar
4 votes

Magento 2 remove My Account and Wishlist link from top links

The login link wasnt remove from the above snippets for me so if anyone is having issues with it too. This snipped worked for me: <referenceBlock name="top.links"> <referenceBlock name="...
astragt's user avatar
  • 139
4 votes
Accepted

How to replace "My Account" with the customer name

In File app/design/frontend/rwd/default/template/page/html/header.phtml Replace <span class=<div class="account-cart-wrapper"> <a href="<?php echo $this->...
Vishwas Bhatnagar's user avatar
4 votes
Accepted

Adding CSS & Target attribute to custom top links in default.xml Magento 2

Try something like this: <block class="Magento\Framework\View\Element\Html\Links" name="ahern-access-nav"> <arguments> <argument name="css_class" xsi:type="string">{{...
circlesix's user avatar
  • 4,273
3 votes

Editing header links in Magento 2

You can change css_class class "header links" by following In default theme you can change or if you have specific theme you change there. /vendor/magento/theme-frontend-luma/Magento_Theme/layout/...
Krishna ijjada's user avatar
3 votes

how to show my account link in header after successfully login in magento 2.0

Here's an example block: use Magento\Customer\Model\Url; use Magento\Framework\App\Http\Context; use Magento\Framework\View\Element\Template; class Links extends Template { /** @var Url $...
Aaron Allen's user avatar
  • 9,009
3 votes

Removing wishlist link - top header magento 2

If you're developing an Enterprise Edition site, wish-list-link is not the droid you're looking for. That block is removed and replaced with multiple-wish-list-link, thus needs to be removed as ...
tommypyatt's user avatar
3 votes
Accepted

Login link add as dropdown into my account magento 2.1.x

You need to create custom module for achieve this function. app/code/Vendor/ModuleName/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\...
Suresh Chikani's user avatar
3 votes
Accepted

Magento layout not working in custom theme

Here are few thing to do: Copy only file-names from parent theme. And copy only required files which need to edit. You only need to add updated code in these files. You add updated code in default....
Jarnail S's user avatar
  • 4,697
3 votes
Accepted

Magento 2: How to add external URL in custom top links

You can use path argumnet to give external link like this: <block class="Magento\Framework\View\Element\Html\Link" name="custom-link"> <arguments> <argument name="label" ...
Prince Patel's user avatar
  • 22.7k
3 votes

how to remove text "items" from top links wishlist magento 2

you can remove it from if you have no theme installed you can go to this and change the 1 item and %1 items. vendor/magento/module-catalog/i18n/en_US.csv or if you have a theme installed you ...
Riddhish Bhayani's user avatar
3 votes
Accepted

Add link to customer-menu

You can create/copy a default.xml file and add your custom link there. If your current/parent theme is Luma, use the top.links. app/design/frontend/vendor/theme/Magento_Customer/layout/default.xml ...
Dinesh Yadav's user avatar
  • 6,447
2 votes

Finding out layout handles being evaluated for a page

For Magento 2 within phtml template files: <?php var_dump($block->getLayout()->getUpdate()->getHandles()); ?>
Chris Rogers's user avatar
2 votes
Accepted

Moving the position of header top links

These are child block of header so you you have to change it in app/design/frontend/namespace/theme/template/page/html/header.php change position of this child block <?php echo $this->...
Qaisar Satti's user avatar
  • 32.5k
2 votes

How do I change text on top links

In your theme create i18n/en_US.csv with the following "Compare Products %1 items","Compare (%1)" "My Wish List %1 items","Wish List (%1)" "My Cart %1 items","Cart (%1)" See https://github.com/...
MagePal Extensions's user avatar
2 votes
Accepted

how to get link My Cart and Check out in top.links in magento2?

Go to your custom theme app/desing/frontend/{Vendor}/{theme}/Magento_Theme/layout/default.xml file. <referenceContainer name="header.panel"> <block class="Magento\Framework\View\...
Rakesh Jesadiya's user avatar
2 votes

Magento 2 remove My Account and Wishlist link from top links

You can just add my-account-link and register-link inside your themes customer module default.xml file and remove from Magento_Theme default.xml file. Wihslist keep inside default.xml of Magento_Theme ...
Rakesh Jesadiya's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible