1
votes

I am starting out in magento theme development and have coded my local.xml to removed 2 blocks below.

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="header">
            <remove name="currency" /><!--removes currency selector--> 
            <remove name="store_language" /><!--removes store language --> 
        </reference>
    </default>
</layout>

This works but the template header.phtml has the block wrapped in divs that are now not needed. See below:

<div class="header-language-background">
    <div class="header-language-container">
        <div class="store-language-container">
            <?php echo $this->getChildHtml('store_language') ?>
        </div>

        <?php echo $this->getChildHtml('currency_switcher') ?>

        <p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>
    </div>
</div>

My question is can I just remove the section from the template file instead of removing the block? Will this effect anything if the blocks are in the xml files but not being called up in any template phtml files?

Thanks :)

2
Hi there are some blocks which hooks inside the template through xml and there is no direct code of those blocks in file , so i will suggest you if you want to remove the blocks who are calling directly in phtml files you have to remove them from template file not from xml file , but if you want to remove the blocks which are auto inserted through xml files the you should remove those blocks from xml.Rohit Goel
it is suggested you remove from xml, instead of from template,as still the blocks would be added to global layout handle object.huzefam

2 Answers

0
votes
  • If the HTML you need to remove is referenced as a XML block then it is better to remove it from the XML using the <remove> node.
  • If the HTML to remove is not referenced as a XML block, removing it from the template directly is the only solution. Of course you should edit the template from your own theme and not the one from the base one.
0
votes

if you remove befault store language then just comment out i header.phtml. like this.

<?php echo $this->getChildHtml('store_language') ?>

Comment...

<?php **//**echo $this->getChildHtml('store_language') ?>