0

I am overwriting my theme logo in my child theme with the default.xml file but the logo is not loading in the storefront.

This is my default.xml code:

<referenceBlock name="logo">
      <arguments>
         <argument name="logo_file" xsi:type="string">images/my-store-logo.jpg</argument>
         <argument name="logo_img_width" xsi:type="number">30</argument>
         <argument name="logo_img_height" xsi:type="number">30</argument>
      </arguments>
</referenceBlock>

My console shows following url for the image:

<img src="https://localhost/magento/pub/static/version1583882139/frontend/Custom/less/en_US/images/my- 
store-logo.jpg" title="" alt="" width="30" height="30">

When i click on the above link it shows the following error message on the new page:

A symlink for "C:/xampp/htdocs/magento/app/design/frontend/Custom/theme-custom- 
less/web/images/my-store-logo.jpg" can't be created and placed to 
"C:/xampp/htdocs/magento/pub/static/frontend/Custom/less/en_US/images/my-store-logo.jpg". 
Warning!symlink(): Cannot create symlink, error code(1314)

This is my store front view: This is my <code>store front</code> view:

Thanks in advance.

Edit: This is my directory structure:

directory structure

4
  • Did you ever resolve this?
    – gnicko
    Commented Apr 8, 2020 at 13:08
  • yes, it was resolved.
    – mobz
    Commented Apr 8, 2020 at 16:51
  • I see that none of the answers here were accepted. Can you share how you fixed it? Perhaps write up an answer to your original question?
    – gnicko
    Commented Apr 9, 2020 at 17:21
  • Good, I'll write up the different scenarios that cause this.
    – mobz
    Commented Apr 11, 2020 at 15:08

2 Answers 2

1

Your code is correct and must be inserted in

/Magento_Theme/layout/default.xml

It seems that your static image is in a less folder(?), is your static file well generated?

You can read https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-create.html#theme_logo

1

Declaration of Theme Logo

Go to app/design/frontend/Demo/Mytheme/Magento_Theme/layout and create a default.xml file. Paste the following code in it:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="logo">
<arguments>
<argument name="logo_file" xsi:type="string">images/mytheme-logo.png</argument>
<argument name="logo_img_width" xsi:type="number">200</argument>
<argument name="logo_img_height" xsi:type="number">200</argument>
</arguments>
</referenceBlock>
</body>
</page>

Upload Theme Logo

Go to app/design/frontend/Demo/Mytheme/web/images and upload your logo (mytheme-logo.png) here.

Apply Your Theme

  • Open the Admin panel of your Magento 2 and go to Content → Configuration.

  • Click on the Edit option.

  • Select Mytheme from the Applied Theme drop-down menu and click on
    Save Configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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