Skip to content

Custom Header Link Layout Update

I have added the below code to app/design/frontend/Company/Theme/Magento_Theme/layout/default.xml but the link is not appearing in the header. Can someone please tell me what I am missing?

       <referenceBlock name="header.links">
            <block class="MagentoFrameworkViewElementHtmlLink" name="test.link" before="-">
                <arguments>
                    <argument name="label" xsi:type="string" translate="false">test</argument>
                    <argument name="path" xsi:type="string" translate="false">test</argument>
                </arguments>
            </block>
        </referenceBlock>

I see you people making a custom block but I don’t see why you cannot use the the native Link block.