2011-11-02 16 views
7

我想在那裏我複製page.xml我的主題佈局文件夾,並修改它像我在Magento中得到了兩次塊?

<page_two_columns_left translate="label"> 
<label>All Two-Column Layout Pages (Left Column)</label> 
<reference name="root"> 
    <action method="setTemplate"><template>page/2columns-left.phtml</template></action> 
    <!-- Mark root page block that template is applied --> 
    <action method="setIsHandle"><applied>1</applied></action> 
</reference> 
<reference name="content"> 
    <block type="core/template" name="mycategories" output="toHtml" template="sweet/sweet.phtml"/> 
</reference> 

在這裏,我在我的主頁中間期待一個一個街區,主頁上創建產品塊我越來越,但除此之外,我在主頁的底部獲得一個多塊(與此塊sweet.phtml相同)..在頁腳鏈接下面。誰能告訴我最新的問題。

+0

您是否試圖用您的名稱替換名爲'mycategories'的某個塊? – Zyava

回答

12

您已將塊標記爲輸出塊。當在控制器動作中通過renderView()呈現視圖時,您的塊既是回聲子項的塊的子項(內容core/text_list塊),也是一個輸出塊,它將在其自身的右側。

刪除output="toHtml"位,你將得到你所需要的。順便說一下,您可以/應該將此更改從自定義page.xml中移動到您的佈局中的local.xml文件中 - 它只需位於<page_two_columns_left />佈局更新句柄內。

+0

太好了,謝謝你......我已經將page.xml複製到我的文件夾中,並且它已經過了很久。我只在那裏進行更改。不好嗎? – ScoRpion

+0

好吧,它會干擾升級途徑。理想情況下,這種更改將在主題的佈局文件夾中的local.xml文件中進行,並且會將page.xml保留在原來的位置。因此,您的local.xml將包含<.../> – benmarks