我试图将我的加密从产品的“内容”视图移到模板中的自己的部分。与Magento块和布局混淆
我的XML看起来是这样的:
<catalog_product_view translate="label">
<reference name="root">
<action method="setTemplate">
<template>page/2columns-left.phtml</template>
</action>
</reference>
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
...other blocks...
<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml" />
....other blocks...
</block>
</reference>
</catalog_product_view>
然后,内page/2columns-left.phtml
它调用$this->getChildHtml('content')
这使得catalog/product/view.phtml
,然后该文件中的调用来$this->getChildHtml('upsell_products')
制成。
我想要做的就是将'upsell_products'移出主'内容'视图(因为它被包装在模板的右栏中),并将其移动到主要的2列模板中,这样加售实际上可以坐在2列布局的下方并跨越页面的整个宽度,而不是被限制在右列。我知道我应该创建一个新的模板,因为现在这不仅仅是2列,但是设置它的正确方法是什么?我尝试了一堆不同的东西,似乎没有任何工作。我希望我已经包含了所有相关的信息。
谢谢,没有意识到你必须声明块的根,我认为这就是让我绊倒。 – Drew