Posted By

kayue on 12/31/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ef


Magento layout


 / Published in: XML
 

  1. <?xml version="1.0"?>
  2. <!-- http://classyllama.com/development/magento-development/the-better-way-to-modify-magento-layout/ -->
  3. <layout version="0.1.0">
  4.  
  5. <default>
  6.  
  7. <reference name="head">
  8. <!-- Magento looks in /skin/frontend/<INTERFACE>/<THEME>/js/buyprinting.js
  9. for this file -->
  10. <action method="addItem"><type>skin_js</type><name>js/buyprinting.js</name></action>
  11.  
  12. <!-- This removes the item that was set in the page.xml file -->
  13. <action method="removeItem"><type>skin_js</type><name>js/iehover-fix.js</name></action>
  14.  
  15. <!-- Magento looks in /js/prototype/element.storage.js for this file -->
  16. <action method="addJs"><name>prototype/element.storage.js</name></action>
  17.  
  18. <action method="addCss">
  19. <stylesheet>css/buyprinting.css</stylesheet></action>
  20. </reference>
  21.  
  22. <reference name="header">
  23. <!-- This adds a CMS block that can be called from the template file
  24. associated with the header block. -->
  25. <block type="cms/block" name="cms_quick_help">
  26. <action method="setBlockId"><block_id>quick_help</block_id></action>
  27. </block>
  28.  
  29. <!-- The remove tag removes the blocks with the specified name from the layout -->
  30. <remove name="top.menu"/>
  31. <remove name="store_language"/>
  32. <remove name="breadcrumbs"/>
  33. </reference>
  34.  
  35. <reference name="top.nav">
  36. <remove name="catalog.topnav"/>
  37. </reference>
  38.  
  39. <reference name="left">
  40. <remove name="left.newsletter"/>
  41. <remove name="left.permanent.callout"/>
  42. <remove name="catalogsearch.leftnav"/>
  43.  
  44. <!-- When you use the remove tag, it removes any blocks with the specified name from
  45. the entire layout, regardless of the context. So, if I remove right.newsletter in
  46. the <default> context and that name is used in say the <catalog_product_view> context,
  47. then both blocks will be removed. Because remove operates on the global context,
  48. you can only remove an element once. Since <remove name="right.newsletter" /> is
  49. being called in catalogsearch.xml, we have to unset it, or else we'll get an error.
  50.  
  51. The line below only unsets the block from the parent's context, not the global
  52. layout context -->
  53. <action method="unsetChild"><name>right.newsletter</name></action>
  54. </reference>
  55.  
  56. <reference name="right">
  57. <!-- Some blocks have to be removed using remove, others via unsetChild.
  58. I've not spent the time digging into the code to figure out why -->
  59. <remove name="right.permanent.callout"/>
  60. <remove name="catalog.compare.sidebar"/>
  61. <remove name="left.reports.product.viewed"/>
  62. <action method="unsetChild"><name>sale.reorder.sidebar</name></action>
  63. <action method="unsetChild"><name>wishlist_sidebar</name></action>
  64. <action method="unsetChild"><name>right.reports.product.viewed</name></action>
  65. <remove name="cart_sidebar"/>
  66. </reference>
  67.  
  68. </default>
  69.  
  70. <!-- CATALOG PAGES -->
  71. <catalog_product_view><!-- 2columns-right -->
  72. <reference name="root">
  73. <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
  74. </reference>
  75. <reference name="content">
  76. <reference name="product.info">
  77. <block type="cms/block" name="cms_product_info_tabs">
  78. <action method="setBlockId"><block_id>product_info_tabs</block_id></action>
  79. </block>
  80. <block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
  81. <action method="unsetChild"><name>tierprices</name></action>
  82. <action method="unsetChild"><name>addto</name></action>
  83. <remove name="addto"/>
  84. <reference name="product.info.options.wrapper.bottom">
  85. <action method="unsetChild"><name>product.tierprices</name></action>
  86. </reference>
  87. </reference>
  88. </reference>
  89. </catalog_product_view>
  90.  
  91. </layout>

Report this snippet  

You need to login to post a comment.