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

Adding CMS banner right beside my logo
 
sfetter
Jr. Member
 
Total Posts:  9
Joined:  2013-08-03
 

Hello,

After furiously searching for a answer on this forum for my issue, I have decided ask this question.

I have placed my code into the page.xml as follows

<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
                    <
label>Page Header</label>
                    <
action method="setElementClass"><value>top-container</value></action>
                </
block>
                 <
block type="page/html_header" name="header" as="header">
                 <
block type="cms/block" name="top_head_banner">
                  <
action method="setBlockId"><block_id>top_head_banner</block_id></action>
                   </
block
            </
block>

My actual code is

<block type="page/html_header" name="header" as="header">
                 <
block type="cms/block" name="top_head_banner">
                  <
action method="setBlockId"><block_id>top_head_banner</block_id></action>
                   </
block>

Then I go into the header .phtml and place the following code

<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 echo $this->getChildHtml(‘top_head_banner’)?>
            <?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>

I have checked to make sure the cms block is active. For some reason it is not working. I am wondering if I have place the code in a wrong place in the sheets.

Thanks in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
 
louise100
Sr. Member
 
Avatar
Total Posts:  168
Joined:  2009-01-26
UK
 

<?php echo $this->getChildHtml(‘top_head_banner’)?>

Not sure if the forum has messed your code up, but the funny quotes could be the problem - try using double quotes or straight quotes like this

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

<?php echo $this->getChildHtml("top_head_banner")?>

Notice how the code changes to the correct colour format grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
Template fans
Guru
 
Total Posts:  446
Joined:  2009-11-02
 

Magento Community version is not easy to customize for a beginner.

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