我試圖將我的加密從產品的「內容」視圖移到模板中的自己的部分。與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