网站首页 / 资讯 / Magento教程/ Magento2.x教程

奇葩小技巧:M2部分主机在特定情况下无法更换logo图片

作者:admin

这种情况我也是第一次见,在后台上传的图片始终不会被前台所读取,一气之下直接写死它。

默认情况下上传图片到

/vendor/magento/theme-frontend-luma/web/images  上传LOGO图片

修改

vendor\magento\module-theme\view\frontend\layout\default.xml

中的

大约64行 LOGO部分代码从

    <block class="Magento\Theme\Block\Html\Header\Logo" name="logo">
                    <arguments>
                        <argument name="logoPathResolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolver</argument>
                        <argument name="logo_size_resolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver</argument>
                    </arguments>
                </block>


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


标签:
上一篇:M2怎样向主题插入后台静态Block块
下一篇:M2数据迁移或是数据库出错导致 inventory_stock_1 视图不存在

相关内容

最近更新
相关产品
综合服务邮箱: magento2#foxmail.com