1
<block class="Magento\Framework\View\Element\Html\Link\Current" name="nav.sitehome"> 
<arguments> 
<argument name="label" xsi:type="string">Link Name</argument> 
<argument name="path" xsi:type="string">link url</argument> 
</arguments> 
</block>

I successfully added a url to my top nav but no of the sequential css came with it. How can I add the correct classes so they end up inline with the other items?

1

I used attributes argument to set target="_blank" to one of my custom links so you can add class with attributes argument in the same way

<block class="Magento\Framework\View\Element\Html\Link\Current" name="nav.sitehome">
    <arguments>
        <argument name="label" xsi:type="string">Link Name</argument>
        <argument name="path" xsi:type="string">link url</argument>
        <argument name="attributes" xsi:type="array">
            <item name="class" xsi:type="string">your-custom-class</item>
        </argument>
    </arguments>
</block>

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.