I've searched all over google and I found a few tutorials that seems straight forward but I can't get it to work in my default.xml
.
Majority of the tutorials uses local.xml but I'm not sure where to find that.
Basically, I removed all the top links and added my own. Here is what I have below. This works BUT I need to be able to add a css class and a target of blank.
Any help would be appreciated:
<referenceBlock name="top.links">
<!-- add ahern access link -->
<block class="Magento\Framework\View\Element\Html\Link\Current" name="ahern-access-link" htmlClass="ahern-access">
<arguments>
<argument name="label" xsi:type="string">Ahern Access</argument>
<argument name="path" xsi:type="string">http://ahernaccess.com</argument>
<argument name="title" xsi:type="string">Log In to Ahern Access</argument>
<argument name="class" xsi:type="string">ahern-access</argument>
</arguments>
</block>
<!-- remove existing blocks -->
<referenceBlock name="header" remove="true" />
<referenceBlock name="register-link" remove="true" />
<referenceBlock name="authorization-link" remove="true" />
<referenceBlock name="wish-list-link" remove="true" />
<referenceBlock name="my-account-link" remove="true" />
</referenceBlock>
Or if there is a way to reference a CMS block in default.xml
?
local.xml
file was used in Magento 1, and has been replaced by thedefault.xml
file of each module in Magento 2. In a M1 site, thelocal.xml
file was placed in the theme and loaded last in the XML tree so you could do any XML overrides there. In M2 thedefault.xml
is loaded on every page on the site and related back to the module based on where it's at in the file structure, but nothing else. So you can ignore the tutorials for anyone talking aboutlocal.xml
as that wont relate to M2