2014-07-03 45 views
1

我有一些麻煩/結算/購物車頁面,採取了兩大塊: - 比較產品可以阻止 - 投票塊投票和比較塊需要取出在Magento

我不能從右側欄刪除 在當前佈局XML

/layout/checkout.xml 

只有我的一模板添加到右sidedar

<reference name="right"> 
my adding template code here 
</reference> 

也是我剛剛刪除了所有添加模板右側欄從

/layout/page.xml

,結果我看到這兩個塊(比較並表決)在無論如何吧(

讓我知道他們可以從哪裏刪除?

感謝

回答

2

我希望你用local.xml做你的自定義設置。

在local.xml中

<default> 
<!--other codes--> 
<remove name="catalog.compare.sidebar" /> 
<remove name="right.poll" /> 
<!--other codes--> 
</default> 

如果需要從結賬刪除 - 只購物車頁面,並保留在其他頁面,然後使用<checkout_cart_index>處理不是和使用"unSetChild".記住<remove>將完全刪除該塊。

+0

非常感謝Anz! 好的答案!它的效果很好 – Pascal

+0

你可以用local.xml來實現幾乎所有的東西,這表明magento真的有多強大。這是最好的和首選的方式,所以請始終避免更改其他XML文件。因爲,magento在每個頁面呈現中創建一個臨時的全局XML,因此覆蓋了本地XML中提到的功能。 – anz

0

我發現在那裏有問題)

Magento的佈局,包括這個

/layout/poll.xml

,並在那裏,我看到了這些線路之一

<!-- Mage_Poll --> 
    <reference name="right"> 
     <block type="poll/activePoll" name="right.poll"> 
      <action method="setPollTemplate"><template>poll/active.phtml</template><type>poll</type></action> 
      <action method="setPollTemplate"><template>poll/result.phtml</template><type>results</type></action> 
     </block> 
    </reference> 

</default> 

後評論它,他們消失)

+0

帕斯卡,是的,但是,上面的答案是正確的方法來完成這一點。如果您要升級Magento,這些更改將會丟失。 – Rob