Tag Archives: xml

Magento How to Remove the Block through XML

Basically there are two ways to remove blocks in layout XML: by using: <remove name=”” /> by using: <action method=”unsetChild”>   Both are important to understand <remove name=”” /> will operate on a global context, after all the layouts are processed which means that it will remove the named layout block completely, regardless of which layout… Read More »

Magento Add Static Block through XML or Phtml

We are assuming  that you know how to add the static block through admin.We can add the Static block in any page through two ways Add through xml <block type=”cms/block” name=”cms_test_block”> <action method=”setBlockId”><block_id>test_block</block_id></action> </block> Through phtml files <?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘ test_block’)->toHTMl(); ?>

Short Rules of XML

If you’re not familiar with it, upon encountering Magento’s XML-based layout updates, you may have a question or two about the rules you must follow when modifying an XML file. Only two set of rule need to remember with XML  is that when a tag opens, it must either be followed by a closing tag (<xml_tag>) or… Read More »