So I wanna add a Link with Icon and the text that says "Contact Us" beside "Mina sidor" in the header. So when u click on Contact Us u are directed to a different page with all contact information.

enter image description here

I have been adding this line of code to my Magento_Theme/layout/default.xml file and after that clearing the cache but nothing happens. I've been looking around but I doesn't seem to find where "Mina sidor" and "Varukorg" are made.

Am I looking in the wrong place?

<referenceBlock name="header.links">
    <block class="Magento\Framework\View\Element\Html\Link" name="new.link" after="register-link">
            <argument name="label" xsi:type="string" translate="false">New Link</argument>
            <argument name="path" xsi:type="string" translate="false">newlink</argument>

Create a layout file

<?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">
    <referenceBlock name="header.panel">
        <block name="customblock" template="Vendor_Module::custom_file.phtml" after="-" />

Now create a template file for this as mentioned in layout and write your code for Text, Link or Icon whatever you wish in the template file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.