25

for me after adding referenceBlock then worked. Tested <referenceBlock name="top.links"> <referenceBlock name="register-link" remove="true" /> <!--for Create Account Link--> <referenceBlock name="authorization-link" remove="true" /> <!--for Sign In Link --> <referenceBlock name="...


18

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="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body>...


14

First copy topmenu.phtml from /app/design/frontend/rwd/default/template/page/html/ Save this file as topmenu.phtml to /app/design/frontend/YOUR PACKAGE/YOUR THEME/template/page/html/ Edit this file within lines 38-40, paste the following: <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-link')->toHtml(); ?> ...


12

In any case do not edit the template file (links.phtml). This serves as a general template for all link lists. For example it is used for the links in the footer also. With toplinks.php you can do whatever you want because is deprecated since CE v1.4.0.1. I recommend using the xml files that add the links to the top container to achieve what you need. The ...


11

You can also remove some of the top links in your local.xml by referencing them and removing them by name. <reference name="top.links"> <remove name="wishlist_link"/> <remove name="checkout_cart_link"/> </reference> This only work if the top link was created with a name like this: <reference name="top.links"> <...


10

The addLink method accepts some extra parameters after position. take a look at Mage_Page_Block_Template_Links::addLink. So your xml could look like this: <block type="page/template_links" name="top.links" as="topLinks"> <action method="addLink" translate="label title"> <label>Blog</label> <url>/blog</url> ...


9

Create your extension with it's own layout file and block that adds links to the top menu. Let's call that Easylife_Locale. You will need the following files: app/etc/modules/Easylife_Locale.xml - the declaration file <?xml version="1.0"?> <config> <modules> <Easylife_Locale> <codePool>local</...


9

In case you need to apply custom template only for Top Links, you can do it like this in your theme's local.xml: <default> <reference name="top.links"> <action method="setTemplate"> <template>page/template/my_links.phtml</template> </action> </reference> <default> Then ...


7

try this Zend_Debug::dump($this->getLayout()->getUpdate()->getHandles());


6

Below code will add a Custom home link under Account drop-down in RWD theme. app/design/frontend/rwd[Package name]/[THEME NAME]/layout/local.xml <?xml version="1.0" encoding="UTF-8"?> <layout version="0.1.0"> <default> <reference name="root"> <reference name="top.links"> <action method="...


6

Mage_Page_Block_Html_Toplinks is indeed deprecated since 1.4.0.1. The new block for adding links is now Mage_Page_Block_Template_Links, which also holds a addLink method. If you check the page.xml you will notice the new block within the header block: <block type="page/template_links" name="top.links" as="topLinks"/>. So the functionality stays the ...


6

you can modify it by edit reference name="top.links" block in following .xml files 1. app/design/frontend/Your_theme/default/layout/checkout.xml 2. app/design/frontend/Your_theme/default/layout/customer.xml Check this following post How to edit header links? You can get more idea from here


6

Use the following code to show your account link in header: <?php $objectManagerlogin = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $objectManagerlogin->get('Magento\Customer\Model\Session'); $baseurl = $objectManagerlogin->get('Magento\Store\Model\StoreManagerInterface')->getStore(0)->getBaseUrl(); ?&...


6

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\Link" name="new.link" after="register-link"> <arguments> <argument name="label" xsi:type="string" translate="false">New Link&...


5

You can use <!-- Removes 'Log Out' link--> <reference name="top.links"> <action method="removeLinkByUrl"> <url helper="customer/getLogoutUrl"/> </action> </reference> Reference: http://sarathlal.com/remove-top-links-in-magento/


5

Finally, I found the solution. I am using luma theme in magento 2. In luma theme new block has been created under header.panel container. Luma has Extend the base layout to add a block. File: vendor/magento/theme-frontend-luma/Magento_Theme/layout/default.xml while in magento blank theme it has created with the name of top.links File: vendor/magento/...


5

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. Something like this: <?php namespace Vendor\Module\Block; class Link extends \Magento\Framework\View\Element\Html\Link { public function _toHtml()...


5

Remove Compare Products link: Theme_Root/Magento_Catalog/layout/default.xml <referenceBlock name="catalog.compare.link" remove="true" /> Remove Default welcome message: Theme_Root/Magento_Theme/layout/default.xml <referenceBlock name="header" remove="true" /> Remove Create an Account link: Theme_Root/Magento_Customer/layout/default....


4

Here is an example on how you can add dynamic links to the top menu: https://magento.stackexchange.com/a/18947/146. In the example above the languages are added to the top links, but you can modify your block to include any language. All you need to change is: Easylife_Locale_Block_Stores::addStoreLinks and make it look like this: public function ...


4

The position is hardcoded in /app/code/core/Mage/Checkout/Block/Links.php: $parentBlock->addLink($text, 'checkout/cart', $text, true, array(), 50, null, 'class="top-link-cart"'); The cart is pos 50 and the checkout link is pos 60. So maybe the easiest way is to position all top.links below 50. But to place just the cart link at the end you would have to ...


4

You need to rewrite the block Mage_Checkout_Block_Links. Here is a tutorial on how to do that, and you need to change the method addCheckoutLink and make it look like this: public function addCheckoutLink() { if (!$this->helper('checkout')->canOnepageCheckout()) { return $this; } $parentBlock = $this->getParentBlock(); if ($...


4

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->helper('customer')->getAccountUrl(); ?>" data-target-element="#header-account" class="skip-account"> <span class="icon"></span&...


4

Try something like this: <block class="Magento\Framework\View\Element\Html\Links" name="ahern-access-nav"> <arguments> <argument name="css_class" xsi:type="string">{{your css class here}}</argument> </arguments> <block class="Magento\Framework\View\Element\Html\Link\Current" name="ahern-access-link"> ...


4

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 getAttributes() So you can use this to insert a target attribute. <block class="Magento\Framework\View\Element\Html\Link\Current" name="custom-link"> <...


4

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 name="label" xsi:type="string" translate="true">My Account</argument> <argument name="class" xsi:type="string" translate="true">account-link&...


3

Your question is a little too generic. What block are you working from in your template example? In a default Magento 1.x CE installation, that block is defined in page.xml as part of the header block declaration: # File: app/design/frontend/base/default/layout/page.xml ... <block type="page/html_header" name="header" as="header"> <block type="...


3

I followed some suggestions from this Magento Forum post, but none of them did the trick for me, but the last one was close. Here's what I did: Copy /app/code/core/Mage/Wishlist/Block/Links.php to /app/code/local/Mage/Wishlist/Block/Links.php Inside the _toHtml() method, add $this->a_params = 'class="your-class"'; just before the return parent::_toHtml();...


3

I believe you can find the answer by looking at _generateAction method inside Mage_Core_Model_Layout class. You will find following strings: ifconfig method block helper json


3

I believe the getHtml function uses the alias from the as attribute, rather than the name. The template should therefore be: <?php echo $this->getHtml('topLinks') ?> Update: you should basically have something roughly along the lines of: page.xml <default> <block type="page/html_header" name="header" as="header"> <...


3

Path:-app/code/core/Mage/Checkout/Block/Links.php copy the file to your Local folder otherwise overwrite the block file. and change the url in addLink() function. here I change the url based on theme name. public function addCheckoutLink() { if (!$this->helper('onestepcheckout')->isRewriteCheckoutLinksEnabled()){ return parent::...


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