How can add link in Header link Before the Welcome Message in magento 2Add custom link fields in header tab in magento 2In Magento2, I want to add cms page link in header top menu before wishlist linkRemoving Welcome message from magento 2 - just xmlHow to add some custom content in magento header before welcome textMagento 2: Disable default header and add custom header contentHow to add custom link in header in magento 2how to add currency switcher dropdown in magento2 custom headerAdd a link into error messageRe-position just the welcome messageMagento 2: Login user programmatically showing wrong default header message “Default welcome msg!” instead of showing “Welcome, user!”
Make a Bowl of Alphabet Soup
Which was the first story featuring espers?
Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?
What is the English pronunciation of "pain au chocolat"?
What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?
Why Shazam when there is already Superman?
The Digit Triangles
Merge org tables
Is a Java collection guaranteed to be in a valid, usable state after a ConcurrentModificationException?
What to do when eye contact makes your coworker uncomfortable?
What fields between the rationals and the reals allow a good notion of 2D distance?
In a multiple cat home, how many litter boxes should you have?
How do I fix the group tension caused by my character stealing and possibly killing without provocation?
What does "Scientists rise up against statistical significance" mean? (Comment in Nature)
What is Cash Advance APR?
US tourist/student visa
The IT department bottlenecks progress, how should I handle this?
Will the Sticky MAC access policy prevent unauthorized hubs from connecting to a network?
What is the difference between lands and mana?
What (the heck) is a Super Worm Equinox Moon?
Pre-mixing cryogenic fuels and using only one fuel tank
Does Doodling or Improvising on the Piano Have Any Benefits?
Can I say "fingers" when referring to toes?
How do I tell my boss that I'm quitting soon, especially given that a colleague just left this week
How can add link in Header link Before the Welcome Message in magento 2
Add custom link fields in header tab in magento 2In Magento2, I want to add cms page link in header top menu before wishlist linkRemoving Welcome message from magento 2 - just xmlHow to add some custom content in magento header before welcome textMagento 2: Disable default header and add custom header contentHow to add custom link in header in magento 2how to add currency switcher dropdown in magento2 custom headerAdd a link into error messageRe-position just the welcome messageMagento 2: Login user programmatically showing wrong default header message “Default welcome msg!” instead of showing “Welcome, user!”
How can add a custom page link in the header Before the Welcome Message
magento2 headerlink
add a comment |
How can add a custom page link in the header Before the Welcome Message
magento2 headerlink
2
I donot think this is a duplicated answer
– Amit Bera♦
Mar 18 at 6:53
add a comment |
How can add a custom page link in the header Before the Welcome Message
magento2 headerlink
How can add a custom page link in the header Before the Welcome Message
magento2 headerlink
magento2 headerlink
edited Mar 18 at 6:52
Amit Bera♦
59.3k1675177
59.3k1675177
asked Mar 18 at 6:42
HaFiz UmerHaFiz Umer
3559
3559
2
I donot think this is a duplicated answer
– Amit Bera♦
Mar 18 at 6:53
add a comment |
2
I donot think this is a duplicated answer
– Amit Bera♦
Mar 18 at 6:53
2
2
I donot think this is a duplicated answer
– Amit Bera♦
Mar 18 at 6:53
I donot think this is a duplicated answer
– Amit Bera♦
Mar 18 at 6:53
add a comment |
4 Answers
4
active
oldest
votes
Please check on below URL. it shows how to add custom blog link.
Let me know if it helps.
https://zemez.io/magento/support/how-to/magento-2-1-x-manage-top-header-links/
Also, need to update theme default.xml file with below code.
<referenceBlock name="header.panel">
<block class="MagentoCmsBlockBlock" name="header_promo_top">
<arguments>
<argument name="block_id" xsi:type="string">header_promo_top</argument>
</arguments>
</block>
</referenceBlock>
2
Please donot p put a single link answer.Answer must has some content
– Amit Bera♦
Mar 18 at 6:55
@AmitBera, Thank you. i will take care from next time.
– Yogesh
Mar 18 at 7:09
add a comment |
Step 1: create a CMS page. For example, we create a “Custom Link” page with an URL such as http://localhost/custom_link
Step 2: Create a default.xml file in the following path: appcodeVendorModuleviewfrontendlayout
with the following content:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class=”Vendor_nameModule_nameBlockLink" name="some_link" >
<arguments>
<argument name="label" xsi:type="string" translate="true">Custom link</argument>
<argument name="path" xsi:type="string">test</argument>
</arguments>
</block>
</referenceBlock>
</body>
Step 3: Create the Block class Link with the following content:
<?php
namespace VendorModuleBlock;
class Link extends MagentoFrameworkViewElementHtmlLink
/**
* Render block HTML.
*
* @return string
*/
protected function _toHtml()
if (false != $this->getTemplate())
return parent::_toHtml();
return '<li><a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '</a></li>';
I hope it helps!
add a comment |
Add this code in default.xml
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountRegisterLink" name="register-link-new" after="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Create an Account</argument>
</arguments>
</block>
<block class="VendorModuleBlockToplink" name="add.subscriptionplan.top" ifconfig="Vendor_Module/general/enable" after="-" />
</referenceBlock>
<referenceBlock name="register-link" remove="true"/>
add a comment |
@Chirag Patel code almost right.
Only have to add below code after
<move element="some_link" destination="header.links" before="-"/>
or
<move element="some_link" destination="header.links" before="header"/>
after </referenceBlock>
tab on default.xml.
It will move your link at first
Thanks @Amit Bera for make good answer to perfect answer. +1 for this. :)
– Chirag Patel
Mar 18 at 7:22
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266268%2fhow-can-add-link-in-header-link-before-the-welcome-message-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please check on below URL. it shows how to add custom blog link.
Let me know if it helps.
https://zemez.io/magento/support/how-to/magento-2-1-x-manage-top-header-links/
Also, need to update theme default.xml file with below code.
<referenceBlock name="header.panel">
<block class="MagentoCmsBlockBlock" name="header_promo_top">
<arguments>
<argument name="block_id" xsi:type="string">header_promo_top</argument>
</arguments>
</block>
</referenceBlock>
2
Please donot p put a single link answer.Answer must has some content
– Amit Bera♦
Mar 18 at 6:55
@AmitBera, Thank you. i will take care from next time.
– Yogesh
Mar 18 at 7:09
add a comment |
Please check on below URL. it shows how to add custom blog link.
Let me know if it helps.
https://zemez.io/magento/support/how-to/magento-2-1-x-manage-top-header-links/
Also, need to update theme default.xml file with below code.
<referenceBlock name="header.panel">
<block class="MagentoCmsBlockBlock" name="header_promo_top">
<arguments>
<argument name="block_id" xsi:type="string">header_promo_top</argument>
</arguments>
</block>
</referenceBlock>
2
Please donot p put a single link answer.Answer must has some content
– Amit Bera♦
Mar 18 at 6:55
@AmitBera, Thank you. i will take care from next time.
– Yogesh
Mar 18 at 7:09
add a comment |
Please check on below URL. it shows how to add custom blog link.
Let me know if it helps.
https://zemez.io/magento/support/how-to/magento-2-1-x-manage-top-header-links/
Also, need to update theme default.xml file with below code.
<referenceBlock name="header.panel">
<block class="MagentoCmsBlockBlock" name="header_promo_top">
<arguments>
<argument name="block_id" xsi:type="string">header_promo_top</argument>
</arguments>
</block>
</referenceBlock>
Please check on below URL. it shows how to add custom blog link.
Let me know if it helps.
https://zemez.io/magento/support/how-to/magento-2-1-x-manage-top-header-links/
Also, need to update theme default.xml file with below code.
<referenceBlock name="header.panel">
<block class="MagentoCmsBlockBlock" name="header_promo_top">
<arguments>
<argument name="block_id" xsi:type="string">header_promo_top</argument>
</arguments>
</block>
</referenceBlock>
edited Mar 18 at 7:08
answered Mar 18 at 6:46
YogeshYogesh
332211
332211
2
Please donot p put a single link answer.Answer must has some content
– Amit Bera♦
Mar 18 at 6:55
@AmitBera, Thank you. i will take care from next time.
– Yogesh
Mar 18 at 7:09
add a comment |
2
Please donot p put a single link answer.Answer must has some content
– Amit Bera♦
Mar 18 at 6:55
@AmitBera, Thank you. i will take care from next time.
– Yogesh
Mar 18 at 7:09
2
2
Please donot p put a single link answer.Answer must has some content
– Amit Bera♦
Mar 18 at 6:55
Please donot p put a single link answer.Answer must has some content
– Amit Bera♦
Mar 18 at 6:55
@AmitBera, Thank you. i will take care from next time.
– Yogesh
Mar 18 at 7:09
@AmitBera, Thank you. i will take care from next time.
– Yogesh
Mar 18 at 7:09
add a comment |
Step 1: create a CMS page. For example, we create a “Custom Link” page with an URL such as http://localhost/custom_link
Step 2: Create a default.xml file in the following path: appcodeVendorModuleviewfrontendlayout
with the following content:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class=”Vendor_nameModule_nameBlockLink" name="some_link" >
<arguments>
<argument name="label" xsi:type="string" translate="true">Custom link</argument>
<argument name="path" xsi:type="string">test</argument>
</arguments>
</block>
</referenceBlock>
</body>
Step 3: Create the Block class Link with the following content:
<?php
namespace VendorModuleBlock;
class Link extends MagentoFrameworkViewElementHtmlLink
/**
* Render block HTML.
*
* @return string
*/
protected function _toHtml()
if (false != $this->getTemplate())
return parent::_toHtml();
return '<li><a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '</a></li>';
I hope it helps!
add a comment |
Step 1: create a CMS page. For example, we create a “Custom Link” page with an URL such as http://localhost/custom_link
Step 2: Create a default.xml file in the following path: appcodeVendorModuleviewfrontendlayout
with the following content:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class=”Vendor_nameModule_nameBlockLink" name="some_link" >
<arguments>
<argument name="label" xsi:type="string" translate="true">Custom link</argument>
<argument name="path" xsi:type="string">test</argument>
</arguments>
</block>
</referenceBlock>
</body>
Step 3: Create the Block class Link with the following content:
<?php
namespace VendorModuleBlock;
class Link extends MagentoFrameworkViewElementHtmlLink
/**
* Render block HTML.
*
* @return string
*/
protected function _toHtml()
if (false != $this->getTemplate())
return parent::_toHtml();
return '<li><a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '</a></li>';
I hope it helps!
add a comment |
Step 1: create a CMS page. For example, we create a “Custom Link” page with an URL such as http://localhost/custom_link
Step 2: Create a default.xml file in the following path: appcodeVendorModuleviewfrontendlayout
with the following content:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class=”Vendor_nameModule_nameBlockLink" name="some_link" >
<arguments>
<argument name="label" xsi:type="string" translate="true">Custom link</argument>
<argument name="path" xsi:type="string">test</argument>
</arguments>
</block>
</referenceBlock>
</body>
Step 3: Create the Block class Link with the following content:
<?php
namespace VendorModuleBlock;
class Link extends MagentoFrameworkViewElementHtmlLink
/**
* Render block HTML.
*
* @return string
*/
protected function _toHtml()
if (false != $this->getTemplate())
return parent::_toHtml();
return '<li><a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '</a></li>';
I hope it helps!
Step 1: create a CMS page. For example, we create a “Custom Link” page with an URL such as http://localhost/custom_link
Step 2: Create a default.xml file in the following path: appcodeVendorModuleviewfrontendlayout
with the following content:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class=”Vendor_nameModule_nameBlockLink" name="some_link" >
<arguments>
<argument name="label" xsi:type="string" translate="true">Custom link</argument>
<argument name="path" xsi:type="string">test</argument>
</arguments>
</block>
</referenceBlock>
</body>
Step 3: Create the Block class Link with the following content:
<?php
namespace VendorModuleBlock;
class Link extends MagentoFrameworkViewElementHtmlLink
/**
* Render block HTML.
*
* @return string
*/
protected function _toHtml()
if (false != $this->getTemplate())
return parent::_toHtml();
return '<li><a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '</a></li>';
I hope it helps!
answered Mar 18 at 6:59
Chirag PatelChirag Patel
2,368423
2,368423
add a comment |
add a comment |
Add this code in default.xml
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountRegisterLink" name="register-link-new" after="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Create an Account</argument>
</arguments>
</block>
<block class="VendorModuleBlockToplink" name="add.subscriptionplan.top" ifconfig="Vendor_Module/general/enable" after="-" />
</referenceBlock>
<referenceBlock name="register-link" remove="true"/>
add a comment |
Add this code in default.xml
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountRegisterLink" name="register-link-new" after="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Create an Account</argument>
</arguments>
</block>
<block class="VendorModuleBlockToplink" name="add.subscriptionplan.top" ifconfig="Vendor_Module/general/enable" after="-" />
</referenceBlock>
<referenceBlock name="register-link" remove="true"/>
add a comment |
Add this code in default.xml
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountRegisterLink" name="register-link-new" after="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Create an Account</argument>
</arguments>
</block>
<block class="VendorModuleBlockToplink" name="add.subscriptionplan.top" ifconfig="Vendor_Module/general/enable" after="-" />
</referenceBlock>
<referenceBlock name="register-link" remove="true"/>
Add this code in default.xml
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountRegisterLink" name="register-link-new" after="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Create an Account</argument>
</arguments>
</block>
<block class="VendorModuleBlockToplink" name="add.subscriptionplan.top" ifconfig="Vendor_Module/general/enable" after="-" />
</referenceBlock>
<referenceBlock name="register-link" remove="true"/>
answered Mar 18 at 6:52
Birjitsinh ZalaBirjitsinh Zala
564115
564115
add a comment |
add a comment |
@Chirag Patel code almost right.
Only have to add below code after
<move element="some_link" destination="header.links" before="-"/>
or
<move element="some_link" destination="header.links" before="header"/>
after </referenceBlock>
tab on default.xml.
It will move your link at first
Thanks @Amit Bera for make good answer to perfect answer. +1 for this. :)
– Chirag Patel
Mar 18 at 7:22
add a comment |
@Chirag Patel code almost right.
Only have to add below code after
<move element="some_link" destination="header.links" before="-"/>
or
<move element="some_link" destination="header.links" before="header"/>
after </referenceBlock>
tab on default.xml.
It will move your link at first
Thanks @Amit Bera for make good answer to perfect answer. +1 for this. :)
– Chirag Patel
Mar 18 at 7:22
add a comment |
@Chirag Patel code almost right.
Only have to add below code after
<move element="some_link" destination="header.links" before="-"/>
or
<move element="some_link" destination="header.links" before="header"/>
after </referenceBlock>
tab on default.xml.
It will move your link at first
@Chirag Patel code almost right.
Only have to add below code after
<move element="some_link" destination="header.links" before="-"/>
or
<move element="some_link" destination="header.links" before="header"/>
after </referenceBlock>
tab on default.xml.
It will move your link at first
answered Mar 18 at 7:16
Amit Bera♦Amit Bera
59.3k1675177
59.3k1675177
Thanks @Amit Bera for make good answer to perfect answer. +1 for this. :)
– Chirag Patel
Mar 18 at 7:22
add a comment |
Thanks @Amit Bera for make good answer to perfect answer. +1 for this. :)
– Chirag Patel
Mar 18 at 7:22
Thanks @Amit Bera for make good answer to perfect answer. +1 for this. :)
– Chirag Patel
Mar 18 at 7:22
Thanks @Amit Bera for make good answer to perfect answer. +1 for this. :)
– Chirag Patel
Mar 18 at 7:22
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266268%2fhow-can-add-link-in-header-link-before-the-welcome-message-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
I donot think this is a duplicated answer
– Amit Bera♦
Mar 18 at 6:53