cancel
Showing results for 
Search instead for 
Did you mean: 

Remove header & footer but retain the logo

SOLVED

Remove header & footer but retain the logo

The Magento Ver is 1.9 and the theme is a variant of the rwd theme.
For a home page design I need to remove the header and footer completely but retain only the logo. I have tried this with the following code in layout update CMS page :
</reference>
<reference name="root">
<remove name="header"/>
<remove name="footer"/>
/reference>

The above code also removes the logo.

The following code retains the logo but also some other elements like Account Icon, search icon & 2 lines etc

<reference name="header">
<remove name="top.links"/>
<remove name="welcome"/>
<remove name="breadcrumbs"/>
<remove name="minicart_head"/>
<remove name="top.search"/>
<remove name="catalog.topnav"/>
<remove name="accountLinks"/>
<remove name="menu"/>
</reference>
Is there any way to just retain the logo and remove every thing else ?
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Remove header & footer but retain the logo

Hi @ApsG 

You can create a new logo.phtml file in page/html folder.

default/template/page/html/logo.phtml

You need to add following code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2018 Magento, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/**
 * @var Mage_Page_Block_Html_Header $this
 */
?>
<div class="header-container">
    <div class="header">
        <?php if ($this->getIsHomePage()):?>
        <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
        <?php else:?>
        <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
        <?php endif?>
    </div>
</div>


then you need to add following line:

<reference name="root">
   <remove name="header"/>
    <remove name="footer"/>
</reference>

<reference name="after_body_start">
            <block type="page/html_header" name="logo" template="page/html/logo.phtml"/>
</reference>


I hope it will work for you!

View solution in original post

5 REPLIES 5

Re: Remove header & footer but retain the logo

Hi @ApsG 

Try the same which your are using. 

<reference name="root">
    <remove name="header"/>
    <remove name="footer"/>
</reference>

and try to call logo block again. 

<cms_index_index>
        <reference name="header">
            <block type="core/template" name="logo" template="page/html/logo.phtml"/>
        </reference>
/cms_index_index>

Please cross verify the "page/html/logo.phtml" path in your theme once. 

I hope it will help you!

Re: Remove header & footer but retain the logo

Hi Vimal,

Thanks for the suggestion but the the "page/html/logo.phtml" is missing in the theme. However, in the final rendering the logo is present.  Certainly being picked up from somewhere in Magento's   theme fall back mechanism.

 

For this to work :

<block type="core/template" name="logo" template="page/html/logo.phtml"/>

The question is where is the logo.phtml ?

Re: Remove header & footer but retain the logo

Hi @ApsG 

You can create a new logo.phtml file in page/html folder.

default/template/page/html/logo.phtml

You need to add following code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2018 Magento, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/**
 * @var Mage_Page_Block_Html_Header $this
 */
?>
<div class="header-container">
    <div class="header">
        <?php if ($this->getIsHomePage()):?>
        <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
        <?php else:?>
        <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
        <?php endif?>
    </div>
</div>


then you need to add following line:

<reference name="root">
   <remove name="header"/>
    <remove name="footer"/>
</reference>

<reference name="after_body_start">
            <block type="page/html_header" name="logo" template="page/html/logo.phtml"/>
</reference>


I hope it will work for you!

Re: Remove header & footer but retain the logo

Yes !  With minor tweaks this works.

 

Had to comment out some code  which was spitting out 2 logos and the Alt logo text.

 

A minor niggle though. On the smaller screen (a mobile device) the logo doesn't resize or use the alternate smaller size logo . A conditional in-line css media query  with alternate image could maybe help fix this.

 

The tweaked code is listed below :

 

<!DOCTYPE html>
<html>


<div class="header-container">
<div class="header">
<?php if ($this->getIsHomePage()):?>
<!-- <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>

<a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong>
-->
<img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
<br/>
<?php endif?>
</div>
</div>
</html>

 

 

Re: Remove header & footer but retain the logo

Is it possible to mantain this customization also for the category associated products?