Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 定制Magento 2容器/横幅_Xml_Magento2 - Fatal编程技术网

Xml 定制Magento 2容器/横幅

Xml 定制Magento 2容器/横幅,xml,magento2,Xml,Magento2,我正在尝试创建我自己的magento 2主题。 我想在顶部的所有页面中添加标题图像 --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceCon

我正在尝试创建我自己的magento 2主题。 我想在顶部的所有页面中添加标题图像

-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="header.panel">
            <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
                <arguments>
                    <argument name="css_class" xsi:type="string">header links</argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_img_width" xsi:type="number">250</argument>
                <argument name="logo_img_height" xsi:type="number">100</argument>
            </arguments>
        </referenceBlock>
        <referenceContainer name="footer">
            <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="switch/stores.phtml"/>
        </referenceContainer>
        <referenceBlock name="report.bugs" remove="true"/>
        <move element="copyright" destination="before.body.end"/>
    </body>
</page>
-->
标题链接
250
100
这是我的默认.xml文件

我想我可以在default.xml中添加一个参考块,如下所示:

 <referenceContainer name="header.panel"> 
        <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
            <arguments>
                <argument name="css_class" xsi:type="string">header links</argument>
            </arguments>
        </block>
    </referenceContainer>

标题链接
但不是我的旗帜。我该怎么做?


 <referenceContainer name="header.panel"> 
    <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
        <arguments>
            <argument name="css_class" xsi:type="string">header links</argument>
        </arguments>
    </block>
</referenceContainer>
标题链接
注。。这就是如何在右侧添加块

<block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="switch/stores.phtml"/>

创建块

<block class="Magento\Framework\View\Element\Template" name="banner" template="banner.phtml"/>

然后把它放在

<referenceContainer name="header.panel"> 
    <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
        <arguments>
            <argument name="css_class" xsi:type="string">header links</argument>
        </arguments>
    </block>
   <block class="Magento\Framework\View\Element\Template" name="banner" template="banner.phtml"/>
</referenceContainer>

标题链接
您必须在以下文件夹中创建。 app/code/YouTheme/banner/view/frontend/templates/banner.phtml

其中banner.phtml是html代码所在的位置

我希望它能给你一个解决问题的办法