2012-07-31 46 views
1

我想添加一個擴展我的默認佈局的頁面。我把內容在一個.phtml文件,然後安裝佈局是這樣的:在Magento模板中擴展默認佈局

<layout version="0.1.0"> 
    <customlanding_index_index> 
     <reference name="root"> 
      <action method="setTemplate"><template>page/1column.phtml</template></action> 
     </reference> 
     <block name="content" as="content" type="core/text_list" template="quantumco/customlanding/landing_page.phtml" /> 
    </customlanding_index_index> 
</layout> 

不幸的是,這一切都讓我爲我的佈局沒有的內容。我假設我錯誤地插入了內容塊,但我無法弄清楚如何讓它工作。

回答

1

參考內容分塊,並添加自己的塊作爲一個孩子:

<layout version="0.1.0"> 
    <customlanding_index_index> 
     <reference name="root"> 
      <action method="setTemplate"><template>page/1column.phtml</template></action> 
     </reference> 
     <reference name="content"> 
      <block type="core/template" name="landing_page" template="quantumco/customlanding/landing_page.phtml" /> 
     </reference> 
    </customlanding_index_index> 
</layout> 

如果塊是一個特定的類型(我不認爲這是基於提供的代碼示例中,然後用替代core/template您的自定義塊類型。

+0

完美的工作!謝謝。 – MrGlass 2012-07-31 19:51:40