2

I refer to the docs at http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html#xml-manage-ref-block saying that this is one of the params possible for that class. I put it into a referenced container and a block below this one is showing it's content but not the logo.

        <block class="Magento\Theme\Block\Html\Header\Logo" name="logo">
            <arguments>
                <argument name="logo_file" xsi:type="string">images/logo.png</argument>
            </arguments>
        </block>

Is there a way to show error messages about this?

Why is the argument not matching the functions in logo.php? It should be the way since the conventions in docs say that it should match the name of the arguments in a certain way.

  • Another way to do this would be to upload the logo in the admin, Stores-> Config-> Design-> Header-> Logo Image. This doesn't answer your question, but might solve your problem. – circlesix Jun 14 '16 at 23:19
  • Thanks though it is more that I need to understand how to adjust a theme. Magento creator made it hard enough to get behind how to do it at all when one comes from the direction to create a webpage in html and php only. I always find myself in the situation to think if I do it all with a clean template or not because I will lose mag functions. But understanding the dev functions is pretty hard. Especially when it does not work. :) I now started to create a layout and simply use template files for filling the container. Just to get something done. – user789660 Jun 14 '16 at 23:38
2

I think the link is just there to show you the syntax of how to reference a block, not change the logo. I took a look at some code I got from this book https://www.packtpub.com/web-development/magento-2-development-cookbook and to set the file you need to use the setLogoFile() method, passing the file name in as a perimeter.

<referenceBlock name="logo">
    <action method="setLogoFile">
        <argument name="logo_file" xsi:type="string">images/logo.png</argument>
    </action>
</referenceBlock>
  • 1
    thanks for the tip. I think that method should do the same the code I used should have been done. Excetpt the method might be helpful. The action method is deprecated in the actual version of magento 2 it seems. At the end I ended up creating and using a simple template file. Might be not the best way but I run out of time. :/ – user789660 Jun 16 '16 at 11:25
  • Didn't know that, I found this post magento.stackexchange.com/questions/86188/… which points to this file in the testing framework github.com/magento/magento2/blob/develop/dev/tests/static/… Good info. – circlesix Jun 16 '16 at 15:28
  • Looks like good info but man... how much does one has to learn with magento? This is worse than typoscript and I was happy to leave typo3 behind. Now theme design is something worse where you have to know very specific commands and all. And you have to use them in order to not lose functionality. sigh – user789660 Jun 17 '16 at 11:11
  • 2
    It's like committing to a horrible relationship until it's wonderful. It seems silly the whole time, but there is that hope that one day it will be amazing. – circlesix Jun 17 '16 at 15:28
  • lol Yeah... I never thought it will be that way when I started with magento/magento 2 :D – user789660 Jun 21 '16 at 13:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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