Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Changing header background
 
vipete
Jr. Member
 
Total Posts:  2
Joined:  2012-11-01
 

Hi there,

I’d like to change the background on my header at: http://beerkingstore.com.br/index.php

The header container just lets me change the middle part.

Below is the header.php code.
Should I add one more div? Where should I do this? What css should I use to make the background cover the full width?
Thanks for this!

<div id="top"></div>

<
div id="header_menu">
    
<?php echo $this->getChildHtml('store_language'?><?php echo $this->getChildHtml('currency'?><?php echo $this->getChildHtml('topLinks'?>
</div>
<
div class="header-container">
    <
div class="header">
        <
div class="header-left">
            
            
<?php echo $this->getChildHtml('topBar'?>    
            
            
            
        
</div>
        
        <
div class="header-center">
            
            
            
<?php if ($this->getIsHomePage()):?>
            
<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>
            
<?php else:?>
            
<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>
            
<?php endif?>
            
<div class="welcome-msg"><?php echo $this->getWelcome() ?></div>
        </
div>        
        <
div class="header-right">
            
            <
div class="minicart-wrapper">
                <
div class="icon" onclick="location.href='<?php echo $this->getUrl('checkout/cart')?>'"></div>
                <
div class="minicart">
                    
                    
<?php echo $this->getChildHtml('top_cart'?>
                    
                
</div>
                
            </
div>
            <
div class="clear"></div>   
            
        </
div>      
    </
div>
    
    
    
<?php echo $this->getChildHtml('topContainer'); ?>

</div>
</
div<? // class=page ?>

<?php echo $this->getChildHtml('topMenu'?>


<?php
$routeName 
Mage::app()->getRequest()->getRouteName();  
$identifier Mage::getSingleton('cms/page')->getIdentifier();  
   
if(
$routeName == 'cms' && $identifier == 'home'{  
    
echo $this->getLayout()->createBlock('cms/block')->setBlockId('revolution_slider')->toHtml();
    echo 
$this->getLayout()->createBlock('cms/block')->setBlockId('promo_block')->toHtml();
else {  
    

?>



<div class="page">
    
<?php echo $this->getChildHtml('topBread'?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
vipete
Jr. Member
 
Total Posts:  2
Joined:  2012-11-01
 

Thanks for the reply!

So can I make a new div in the header.phtml ?
Were should I put these divs?
I just want to show this different bg in the header.
Can I use a pattern that will be repeated too?

Like:

<div id="headerbg">
  <
img src="images/bg.jpg" alt="">
</
div>

#headerbg {
  
positionfixed
  
top: -50%; 
  
left: -50%; 
  
width200%; 
  
height200%;
}
#headerbg img {
  
positionabsolute
  
top0
  
left0
  
right0
  
bottom0
  
marginauto
  
min-width50%;
  
min-height50%;
}

I am not sure if it is what I al looking for. Background can be pattern that is repeated, but it should be visible full width and not just inside the headercontainer…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top