Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.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
Php Magento为cms小部件添加参考块_Php_Xml_Magento - Fatal编程技术网

Php Magento为cms小部件添加参考块

Php Magento为cms小部件添加参考块,php,xml,magento,Php,Xml,Magento,我正在尝试在我的产品视图页面中添加滑块。CMS小部件中已经有一些预设,但它们都不在我想要的位置 首先,我进入page.xml并添加: <block type="core/text_list" name="testproduct" as="test_product" translate="label"> <label>TEST PRODUCT</label> </block> 但是当我尝试创建

我正在尝试在我的产品视图页面中添加滑块。CMS小部件中已经有一些预设,但它们都不在我想要的位置

首先,我进入page.xml并添加:

        <block type="core/text_list" name="testproduct" as="test_product" translate="label">
            <label>TEST PRODUCT</label>
        </block>

但是当我尝试创建一个小部件时,页面上什么也没有显示

您在
page.xml
中的什么位置添加了该xml,您引用的是哪个
view.phtml
文件?您在哪个page.xml中添加了它?你必须给我们更多的信息。通常,你需要有一个参考来告诉在哪个块中添加你的块。我有自己的主题文件夹,所以在app/design/frontend/theme/layout/page.xml中。然后view.phtml位于app/design/frontend/theme/template/catalog/product中。因此,在page.xml中,我把它放在“Main content area”块下,在view.phtml中,我将其作为“媒体”的回应。您在
page.xml
中的何处添加了该xml,您引用了哪个
view.phtml
文件?您在哪个page.xml中添加了它?你必须给我们更多的信息。通常,你需要有一个参考来告诉在哪个块中添加你的块。我有自己的主题文件夹,所以在app/design/frontend/theme/layout/page.xml中。然后view.phtml位于app/design/frontend/theme/template/catalog/product中。因此,在page.xml中,我把它放在“Main content area”块的正下方,在view.phtml中,我响应它而不是“media”。
echo $this->getChildHtml('test_product');