Skip to main content
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,580
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,439
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 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,323
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,592
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

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,323
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,707
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.8k
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,465
3 votes
Accepted

Add custom link to top.links section

Try this, create default.xml file in app/code/Vendorname/ModuleName/view/frontend/layout directory. <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
ndev's user avatar
  • 56
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
2 votes
Accepted

Customer Log In URL

Yes, this is correct. The login URL is ok. The letters and numbers are actually a base 64 decoded URL of the site your customer was before the login. They will be redirected to this page. You can ...
Anna Völkl's user avatar
  • 17.4k
2 votes
Accepted

Magento 2 : How to change position of Sign in and My Account link?

Just add code inside default.xml file with after attribute after="authorization-link", <referenceBlock name="top.links"> <block class="Magento\Customer\Block\Account\...
Rakesh Jesadiya's user avatar
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

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

I would recommend using icomoon or fontawesome and include the icons on a "before" element for each link with less/css targeting the class. Does this help or you need an example?
Vlad Patru's user avatar
  • 1,200
2 votes

How to override top.links in magento 2

The top.links can be overriten in defaul.xml of your theme something like: <referenceBlock name="top.links"> <block class="Magento\Customer\Block\Account\Link" name="my-account-link"> ...
Vlad Patru's user avatar
  • 1,200

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