What are the possible Argument Namespaces for Logos

by H. Ferrence   Last Updated August 16, 2018 16:09 PM

I am tweaking my theme using the xml approach.

I have this xml code:

<referenceBlock name="logo">
        <argument name="logo_file" xsi:type="string">images/my-override-logo.png</argument>
        <argument name="logo_img_width" xsi:type="number">160</argument>
        <argument name="logo_img_height" xsi:type="number">240</argument>
        <argument name="logo_img_alt" xsi:type="string">Alt string for SEO and Accessibility purposes</argument>

My alt string is not correctly coded because I can't get the alt attribute string to render to the page. Any suggestions?

Tags : magento2 image xml

Answers 3

not 100% sure about this, but it looks like they changed the key to logo_alt and did not update it in the themes: https://github.com/magento/magento2/blob/develop/app/code/Magento/Theme/Block/Html/Header/Logo.php#L78

So it will take the value from the backend configuration if nothing else is defined for logo_alt

David Verholen
David Verholen
April 01, 2016 19:29 PM

There is an alternative option to do it via admin:

Navigate in admin Stores->Design->Header->Logo Image Alt = 'Put your desired title'

save the config and refresh the cache it's done.

April 04, 2016 09:28 AM

<argument name="logo_alt" xsi:type="string">Alt string for SEO and Accessibility purposes</argument>
El Muerto
El Muerto
August 16, 2018 15:16 PM

Related Questions

AbstractFieldArray with Image Upload

Updated June 12, 2017 08:09 AM