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 ...
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="...
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" />
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\...
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. ...
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/...
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]/[...
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 ...
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('...
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 ...
5
votes
Remove Specific Top Links
You can use
<!-- Removes 'Log Out' link-->
<reference name="top.links">
<action method="removeLinkByUrl">
<url helper="customer/getLogoutUrl"/>
<...
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 ...
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="...
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:
<...
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="...
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->...
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">{{...
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/...
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 $...
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 ...
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\...
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....
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" ...
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 ...
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
...
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()); ?>
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->...
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/...
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\...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
toplinks × 161magento2 × 59
magento-1.9 × 31
layout × 27
header × 26
magento-2.1 × 12
xml × 11
navigation × 10
topmenu × 10
login × 9
blocks × 8
magento-1.8 × 7
customer × 7
theme × 7
menu × 7
css × 6
frontend × 5
custom × 5
wishlist × 5
magento-1.7 × 4
url × 4
customer-account × 4
local.xml × 4
link × 4
default.xml × 4